一、安装matplotlib
1. 安装 expat
sudo yum install expat-devel
2. LIBDBUS_1_3 not defined
下载地址
编译安装:
./configure --prefix=/opt/Qt5.12.1/Tools/QtCreator/lib/Qt/
make
cd ./dbus/.libs
sudo cp libdbus-1.so /opt/Qt5.12.1/Tools/QtCreator/lib/Qt/lib
sudo cp libdbus-1.so.3 /opt/Qt5.12.1/Tools/QtCreator/lib/Qt/lib
sudo cp libdbus-1.so.3.26.0 /opt/Qt5.12.1/Tools/QtCreator/lib/Qt/lib
3. undefined symbol: FT_Get_Font_Format
下载地址
编译安装
cd freetype-2.10.0
./configure --prefix=/opt/Qt5.12.3/Tools/QtCreator/lib/Qt/
make
cd ./objs/.libs
sudo cp libfreetype.so /home/dd/anaconda3/lib/python3.8/site-packages/PyQt5/Qt/lib
sudo cp libfreetype.so.6 /home/dd/anaconda3/lib/python3.8/site-packages/PyQt5/Qt/lib
sudo cp libfreetype.so.6.17.0 /home/dd/anaconda3/lib/python3.8/site-packages/PyQt5/Qt/lib
安装pyqt5
1. qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
解决办法:
- 命令行执行
export QT_DEBUG_PLUGINS=1
,查看调试信息。主要看最后一段
QFactoryLoader::QFactoryLoader() checking directory path "/home/dd/anaconda3/bin/platforms" ...
Cannot load library /home/dd/anaconda3/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so: (/usr/lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /home/dd/anaconda3/bin/../lib/libpng16.so.16))
QLibraryPrivate::loadPlugin failed on "/home/dd/anaconda3/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /home/dd/anaconda3/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so: (/usr/lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /home/dd/anaconda3/bin/../lib/libpng16.so.16))"
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
已放弃 (核心已转储)
核心问题为
"Cannot load library /home/dd/anaconda3/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so: (/usr/lib64/libz.so.1: version `ZLIB_1.2.9' not found
2. 安装zlib1.2.9
下载地址
下载完成解压进行编译,执行命令:
1. cd zlib-1.2.9
2. ./configure
3. make -j8
4. sudo make install
5. ln -sf libz.so.1.2.9 /home/dd/anaconda3/lib/python3.8/site-packages/PyQt5/Qt/plugins/platforms//libqxcb.so
以上并没有什么卵用,还把系统搞崩了
解决办法:打开pycharm-settings-project-pythoninterpreper 右边“+”号,用pycharm 包管理器安装pyqt,完美解决
三、安装g++,gfortran编译环境
1.更新yum 源
网上办法多为更新yum源,然后使用yum install gcc-g++
安装g++,使用yum install gcc-gfortran
安装gfortran。更新方法参考:中标麒麟操作系统yum源配置,折腾了一天换了无数源,没有解决问题。
- 使用rpm安装
- 挂载CD
在一个目录执行
mkdir cd-dvd
mount /dev/cdrom cd-dvd
cd cd-dvd/Packages
找到需要安装的文件,执行:
rpm -ivh rpm 包文件名
完美解决