安装matlab后PyQt4运行出错

只需将MATLAB下libQtCore.so.4、libQtGui.so.4两个链接改到/usr/lib/x86_64-linux-gnu/目录对应的链接,具体过程人如下:

$ python QtPytest1.py 

Traceback (most recent call last):

  File "QtPytest1.py", line 4, in <module>

    from PyQt4 import QtCore, QtGui

ImportError: /usr/lib/python2.7/dist-packages/PyQt4/QtCore.so: undefined symbol: _ZN7QLocale14scriptToStringENS_6ScriptE

$ sudo rm /opt/local/MATLAB/R2012a/bin/glnxa64/libQtCore.so.4

$ sudo ln -s /usr/lib/x86_64-linux-gnu/libQtCore.so.4 /opt/local/MATLAB/R2012a/bin/glnxa64/libQtCore.so.4


$ python QtPytest1.py Traceback (most recent call last):

  File "QtPytest1.py", line 4, in <module>

    from PyQt4 import QtCore, QtGui

ImportError: /opt/local/MATLAB/R2012a/bin/glnxa64/libQtGui.so.4: undefined symbol: _ZN14QObjectPrivate32removePendingChildInsertedEventsEP7QObject

$ ll /opt/local/MATLAB/R2012a/bin/glnxa64/libQtGui.so.4

lrwxrwxrwx 1 root root 17 11月 28 19:28 /opt/local/MATLAB/R2012a/bin/glnxa64/libQtGui.so.4 -> libQtGui.so.4.7.1

$ sudo rm /opt/local/MATLAB/R2012a/bin/glnxa64/libQtGui.so.4

$ sudo ln -s /usr/lib/x86_64-linux-gnu/libQtGui.so.4 /opt/local/MATLAB/R2012a/bin/glnxa64/libQtGui.so.4

修改后

$ python QtPytest1.py 

可正常运行,MATLAB的运行暂时无异常,作此记录,待有问题时改回

gtk3也会有问题,见

http://blog.sina.com.cn/s/blog_54dd80920102v5js.html

cd   /opt/local/MATLAB/R2012a/bin/glnxa64

rm   libfreetype.so.6

sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so.6.11.1 libfreetype.so.6

问题解决


你可能感兴趣的:(安装matlab后PyQt4运行出错)