Statement: This article is quoted from http://blog.csdn.net/djstavav/article/details/50218157, and in its own practice has made the update and supplement, hope to be able to help you developers, less detours. Hardware and Software Environment
- OS X EI Capitan
- Python 3.5.1
- PyQt 5.6.0
- Pycharm 5.0
Objective
QT is an open-source, cross-platform GUI framework that provides application development interfaces for many computer languages, as well as an integrated development environment Qtcreator, UI authoring tools Qtdesigner, which are easy to use and speed up development. This paper completes the construction of the development environment based on Python3.5.1 QT5.
Installing the development Environment Python 3.5.1
https://www.python.org/downloads/mac-osx/, click Finish installation.
Sip 4.18
Https://www.riverbankcomputing.com/software/sip/download
Compiling the installation steps
tar xvf sip-4.18.tar.gzcd sip-4.18python3.5 configure.py -d /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packagesmakesudo make install
PyQt 5.5.1
Https://riverbankcomputing.com/software/pyqt/download5
Compiling the installation steps
Tar xvf pyqt-gpl-5.6.0.tar.gz
CD pyqt-gpl-5.6.0
python3.5 configure.py--qmake/usr/local/cellar/qt5/5.6.0/bin/qmake--disable=qtpositioning-d/Library/Frameworks/ Python.framework/versions/3.5/lib/python3.5/site-packages
Yes
Make here compiles C + + files, takes a long time, about 10 minutes
sudo make install
–qmake option to make Qmake path, you need to modify, and compile with the compile option disable-qtpositioning, if not added, there will be a compilation error
If your program needs to use this module, you can create a new header file, please refer to the StackOverflow in this article http://stackoverflow.com/questions/33446131/ Pyqt5-error-during-python3-configure-py-fatal-error-qgeolocation-h-file-no
Test the development environment
Knock down the following code in the terminal, if there is no error, the installation is successful.
python3.5 -c "import PyQt5"
Used in the Pycharm.
Pycharm is now the most popular Python ide, from the JetBrains company, they have other very good IDE, interested can try. Https://www.jetbrains.com/pycharm/?fromMenu, install finished, open Preferences->project interpreter Select the Python3.5.1 we just installed, click OK.
Complete
Build python3.5.1+pyqt5.6 development environment under MAC OS X