一、下载pycharm

(1)进入官网下载Download PyCharm: The Python IDE for data science and web development by JetBrains

选择专业版(professional)直接点击下载(download),我下载的是2023.3.5版本。

(2)进行本地解压

-------------------------------------------先不要安装,为后面做准备工作------------------------------------------

二、重置PyCharm(新安装的不需要)

(1)打开scripts文件夹,选择uninstall.sh文件运行(ubuntu用户选择这个,windows用户选择.vbs)

ubuntu18.04 pycharm-LMLPHP

运行:

sh ./uninstall.sh

(这个文件是卸载文件)

出现提示Done,即运行成功。

(2)运行install.sh文件

ubuntu18.04 pycharm-LMLPHP

如果运行失败,请检查scripts及上级文件路径是否有中文,必须保证路径全英文。

提示Done即运行成功。

三、修改pycharm64.vmoptions文件

ubuntu18.04 pycharm-LMLPHP

使用vim打开文件,加入以下内容:

其中第一行的地址需要修改为自己ja-netfilter.jar文件所在绝对路径,前面的-javaagent不能修改。

-javaagent:/Downloads/jetbra/jetbra/ja-netfilter.jar

--add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
--add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED

ubuntu18.04 pycharm-LMLPHP

三、修改hosts文件

命令窗口输入:

sudo gedit /etc/hosts

在里面添加:

0.0.0.0 account.jetbrains.com

ubuntu18.04 pycharm-LMLPHP

四、PyCharm

(1)进入到下载包的bin文件夹里面

cd /Downloads/pycharm-professional-2023.3.5/pycharm-2023.3.5/bin

(2)执行pycharm.sh文件,开始安装

sh ./pycharm.sh

(3)选择Activation Code方式

输入注册码,然后点击“Activate”即可。

注册码在这个文件内:

ubuntu18.04 pycharm-LMLPHP

注:这里第一次用注册码我操作成功了但是马上又让重新输入,然后换了其他的,附在下面,大家可以尝试一下:

WNlbnNlSWQ-eyJsaWNlbnNlSWQiOiJLUThLTUo3N1RZIiwibGljZW5zZWVOYW1lIjoiVW5pdmVyc2l0YXMgTmVnZXJpIE1hbGFuZyIsImxpY2Vuc2VlVHlwZSI6IkNMQVNTUk9PTSIsImFzc2lnbmVlTmFtZSI6IkpldO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xFjAUBgNVBAMMDUpldFByb2ZpbGUgQ0GCCQDSbLGDsoN54TATBgNVHSUEDDAKBggrBgEFBQcDATALBgNVHQ8EBAMCBaAwDQYJKoZIhvcNAQELBQADggIBANLG1anEKid4W87vQkqWaQTkRtFKJ2GFtBeMhvLhIyM6Cg3FdQnMZr0qr9mlV0w289pf/+M14J7S7SgsfwxMJvFbw9gZlwHvhBl24N349GuthshGO9P9eKmNPgyTJzTtw6FedXrrHV99nC7spaY84e+DqfHGYOzMJDrg8xHDYLLHk5Q2z5TlrztXMbtLhjPKrc2+ZajFFshgE5eowfkutSYxeX8uA5czFNT1ZxmDwX1KIelbqhh6XkMQFJui8v8Eo396/sN3RAQSfvBd7Syhch2vlaMP4FAB11AlMKO2x/1hoKiHBU3oU3OKRTfoUTfy1uH3T+t03k1Qkr0dqgHLxiv6QU5WrarR9tx/dapqbsSmrYapmJ7S5+ghc4FTWxXJB1cjJRh3X+gwJIHjOVW+5ZVqXTG2s2Jwi2daDt6XYeigxgL2SlQpeL5kvXNCcuSJurJVcRZFYUkzVv85XfDauqGxYqaehPcK2TzmcXOUWPfxQxLJd2TrqSiO+mseqqkNTb3ZDiYS/ZqdQoGYIUwJqXo+EDgqlmuWUhkWwCkyo4rtTZeAj+nP00v3n8JmXtO30Fip+lxpfsVR3tO1hk4Vi2kmVjXyRkW2G7D7WAVt+91ahFoSeRWlKyb4KcvGvwUaa43fWLem2hyI4di2pZdr3fcYJ3xvL5ejL3m14bKsfoOv

如果还是不行建议重启。

五、添加桌面快捷方式

在/usr/share/applications创建一个文件:pycharm.desktop

输入以下内容:

cd /usr/share/applications
sudo gedit pycharm.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=Pycharm
Icon=/Downloads/pycharm-professional-2023.3.5/pycharm-2023.3.5/bin/pycharm.png
Exec=sh /Downloads/pycharm-professional-2023.3.5/pycharm-2023.3.5/bin/pycharm.sh
MimeType=application/x-py;
Name[en_US]=pycharm

下面两句修改成自己的路径:

Icon=/Downloads/pycharm-professional-2023.3.5/pycharm-2023.3.5/bin/pycharm.png
Exec=sh /Downloads/pycharm-professional-2023.3.5/pycharm-2023.3.5/bin/pycharm.sh
03-30 10:14