Configuring the PYQT5 Environment for python3.4 on Linux Mint 17.1

Source: Internet
Author: User
Tags linux mint

1. Installing QT

Configure QT PATH

Append in the/etc/profile file

Export qtdir=/usr/local/qt5.4.2/5.4/gcc_64export ld_library_path=${ld_library_path}:${qtdir}/libexport Path=${qtdir}/bin:${path} 

Note the order of ${qtdir}/bin and ${path}! Because there are many QT commands in the Ubuntu14.04 default ${path} path (specifically a soft connection to Qtchooser, Qtchooser will eventually choose the QT4 command that comes with the system: but these commands do not exist by default), if ${ Qtdir}/bin after ${path} causes the QT command to fail.

In particular, the Qmake command, in the subsequent installation of the need to use, insurance, in the terminal input qmake, if the display qmake command does not exist, please create a soft connection to resolve:

Soft connect the Qmake under/usr/bin to the/usr/local/qt5.4.2/5.4/gcc_64/bin/qmake:

sudo ln-s/usr/local/qt5.4.2/5.4/gcc_64/bin/qmake/usr/bin/qmake

2. Installation of Python3.4 and Python3.4-dev

3. Installing SIP

Install first

sudo Install Pyqt5-dev

SIP is a necessary module for Python to call the C + + library. Therefore, SIP is a dependent tool for PYQT, and the corresponding version of SIP must be installed before installing PYQT. PYQT The SIP version used at compile time must be consistent with the SIP that Python calls by default! Otherwise, the PYQT cannot be called in Python. Here we use the latest SIP 4.16.8.

Ubuntu14.04 seems to be with the 4.15 version of the SIP (or self-installing Python extensions are installed automatically). Terminal input:

Sip-v  

Review the installed SIP version and, if there are other versions, see if there are SIP-related files in the Dist-packages directory of the Python3. If it is present, delete it:

sudo -rm /usr/lib/python3/dist-packages/sip*  

And then formally install SIP4.16.8

tar -zxvf sip-4.16. 8. Tar . GZ CD SIP-4.16. 8 Python3 configure.py sudo  Make sudo  Make Install

SIP does not need to be configured, just need to check the version after the installation is complete:

Enter in the terminal separately:

python3>>>Import sip>>>print (sip. SIP_VERSION_STR)

See if the versions shown are consistent. If this is not the case, you need to re-execute the removal process and installation process. A version inconsistency would mean that the SIP inconsistent with the SIP and Python3 calls used in the subsequent compilation of the PYQT, resulting in calls to the related module in Python3 called PYQT (from PyQt5 import Qtcore) with an error similar to the following:

The SIP module implements API v11. 0 But the Pyqt5.qtcore module requires API v11. 1  

4. Installing PYQT5

5. Installing QSCINTILLA2

Dependency Packages

sudo Install Libgl1-mesa-dev

Configuring the PYQT5 Environment for python3.4 on Linux Mint 17.1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.