Install PyQt5

1 install Qt5

download the install file from http://download.qt.io/official_releases/qt/5.6/5.6.0/qt-opensource-linux-x64-5.6.0.run
set the executive right of downloaded file.
chmod a+x qt-opensource-linux-x64-5.6.0.run
Follow the guide to finish the installation.
Add the Qt path to bash environment.

export QTDIR=/opt/Qt5.6.0/5.6/gcc_64
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${QTDIR}/lib
export PATH=${QTDIR}/bin:${PATH}

To test the installation, use qmake command.

2 install SIP before PyQt

download the source file from http://liquidtelecom.dl.sourceforge.net/project/pyqt/sip/sip-4.17/sip-4.17.tar.gz

tar xvf sip-4.17/sip-4.17.tar.gz
cd sipsip-4.17/sip-4.17
python configure.py
sudo make
sudo make install

To test the installation, use sip -V command.
In python,

>>> import sip  
>>> print(sip.SIP_VERSION_STR)

3 install PyQt5

download the source file from http://iweb.dl.sourceforge.net/project/pyqt/PyQt5/PyQt-5.5.1/PyQt-gpl-5.5.1.tar.gz

tar xvf PyQt-gpl-5.5.1.tar.gz
cd PyQt-gpl-5.5.1
python configure.py
sudo make
sudo make install

Although the installation process seems successfully. When we import some modules of PyQt5, there's an error "No module named 'PyQt5'".
Then we check the build process of PyQt. The same problem was discussed in http://stackoverflow.com/questions/21486103/pyqt5-without-qtgui-and-qtwidgets
The reason is the installation may be missing OpenGL. The solution is

sudo apt-get install freeglut3-dev

Then

python configure.py

works correctly.

ALL DONE

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容

  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的閱讀 13,524評(píng)論 5 6
  • 簡(jiǎn)書(shū)的 markdown 沒(méi)有目錄,截圖一張,讓大家看的清楚,找到自己需要的東西。 更新日志:2017年12月3日...
    inke閱讀 91,219評(píng)論 57 225
  • Qt是屬于一個(gè)跨平臺(tái)的GUI開(kāi)發(fā)軟件,支持的平臺(tái)有Unix、Linux、Windows/WinCE、IOS等。 Q...
    一葉之界閱讀 8,199評(píng)論 0 17
  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc閱讀 2,906評(píng)論 0 0
  • 去琴房途經(jīng)操場(chǎng) 一群鴿子進(jìn)食 不理我? 揮舞雙臂,嚇 鴿子低飛又落 如雷般吼、再?lài)?飛而又落 噢、噢、啊、啊 連吼...
    天馬謠閱讀 353評(píng)論 0 1