Loongnix安装PyCharm Community 2020.2.3的教程详解
安装java运行环境
loongnix官方仓库里面的openjdk
是1.8.0_212
版本, 已经测试通过
$ sudo yum install -y java-latest-openjdk $ java -version # openjdk version "1.8.0_212"
下载程序包
官网下载地址:
https://www.jetbrains.com/pycharm/download/other.html
本文撰写时使用的是linux2020.2.3
版本tar.gz
格式压缩包
解压程序包并运行
$ tar -zxvf pycharm-community-2020.2.3.tar.gz $ cd pycharm-community-2020.2.3 $ ./bin/pycharm.sh
手动启动正常, 没有报错
添加快捷方式到xfce4的程序菜单中
$ vim ~/.local/share/applications/jetbrains-pycharm-ce.desktop
编辑内容如下:
[desktop entry] version=1.0 type=application name=pycharm community edition icon=/home/lpwm/apps/pycharm-community-2020.2.3/bin/pycharm.png exec="/home/lpwm/apps/pycharm-community-2020.2.3/bin/pycharm.sh" %f comment=人生苦短,我用python categories=development;ide; terminal=false startupwmclass=jetbrains-pycharm-ce
解决terminal无法启动问题
在pycharm中打开terminal面板遇到了错误:
查看了下~/.cache/jetbrains/pycharmce2020.2/log/idea.log
日志
suppressed: java.io.ioexception: native library (home/lpwm/apps/pycharm-community-2020.2.3/lib/pty4j-native/linux/x86_64/libpty.so) not found in resource path (/home/lpwm/apps/pycharm-community-2020.2.3/lib/bootstrap.jar:/home/lpwm/apps/pycharm-community-2020.2.3/lib/extensions.jar:/home/lpwm/apps/pycharm-community-2020.2.3/lib/util.jar:/home/lpwm/apps/pycharm-community-2020.2.3/lib/jdom.jar:/home/lpwm/apps/pycharm-community-2020.2.3/lib/log4j.jar:/home/lpwm/apps/pycharm-community-2020.2.3/lib/trove4j.jar:/home/lpwm/apps/pycharm-community-2020.2.3/lib/jna.jar)
调用lib/pty4j-native/linux/x86_64/libpty.so
的时候出现了问题,关键是我这是mips64架构,看来还得动手解决了,参考*上的这个问题进行解决:
主要过程就是从jetbrains官方的git仓库中克隆pty4j
代码,在本地使用gcc
编译libpty.so
动态链接文件(类似于windows 中的dll文件),最后用编译的so文件替换之前的x86_64架构适用的文件
$ sudo yum install -y git $ git clone https://github.com/jetbrains/pty4j.git $ cd pty4j/native $ gcc -fpic -c *.c $ gcc -shared -o libpty.so *.o $ rm /home/lpwm/apps/pycharm-community-2020.2.3/lib/pty4j-native/linux/x86_64/libpty.so $ cp libpty.so /home/lpwm/apps/pycharm-community-2020.2.3/lib/pty4j-native/linux/x86_64/
搞定后重启一下pycharm,再开terminal面板就正常了
解决external file changes sync may be slow问题
跟上面的问题类似,pycharm官方对非x86平台的支持并不完美,还是需要手工编译相关的依赖,这里需要手工编译一个叫fsnotifier
的应用,官方文档:https://confluence.jetbrains.com/display/ideadev/compiling+file+watcher
按照官方文档上说的流程进行编译,结果不出意外的悲剧了,报错
[lpwm@sugon fix]$ sh make.sh *** compiling platform-specific version (fsnotifier-mips64)... main.c: 在函数‘report_event'中: main.c:436:16: 警告:initialization discards ‘const' qualifier from pointer target type char* copy = path, *p; ^
不过倒是生成了fsnotifier-mips64
二进制文件,貌似没影响吧,继续后面的操作
$ cp fsnotifier-mips64 ~/apps/pycharm-community-2020.2.3/bin/
重新启动pycharm, 点击菜单栏中的help
-edit custom properties
,提示创建idea.properties
配置文件,写入下面内容
idea.filewatcher.executable.path = fsnotifier-mips64
重启pycharm, 欧耶!没有提示了!
到此这篇关于loongnix安装pycharm community 2020.2.3的教程详解的文章就介绍到这了,更多相关loongnix安装pycharm community内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!
上一篇: C++算法之直接插入排序算法详解
下一篇: app如何借助软文推广达到效果