安裝matlab後PyQt4運行出錯

只需將MATLAB下libQtCore.so.四、libQtGui.so.4兩個連接改到/usr/lib/x86_64-linux-gnu/目錄對應的連接,具體過程人以下:html

$ python QtPytest1.py python

Traceback (most recent call last):linux

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

    from PyQt4 import QtCore, QtGuiui

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

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

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


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

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

    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

問題解決

相關文章
相關標籤/搜索