Mac OS x Build Qt5 based on Python3.5.1 development environment tutorial

Source: Internet
Author: User
Tags versions

QT is an open source Cross-platform GUI framework that provides an application development interface for many computer languages, as well as an integrated development environment Qtcreator, UI-making work Qtdesigner, easy to use and faster to develop. This paper completes the QT5 based on the Python3.5.1 development environment.

Hardware and Software Environment

OS X EI Capitan

Python 3.5.1

PyQt 5.5.1

Pycharm 5.0.1

Install the development environment

Python 3.5.1

Download Address https://www.python.org/downloads/mac-osx/, click Finish installation.

Sip 4.17

Download Address Https://www.riverbankcomputing.com/software/sip/download

Compiling installation steps

Tar xvf sip-4.17.tar.gz

CD sip-4.17

python3.5 configure.py-d/library/frameworks/python.framework/versions/3.5/lib/python3.5/site-packages

Make

sudo make install

PyQt 5.5.1

Download Address Https://riverbankcomputing.com/software/pyqt/download5

Compiling installation steps

Tar xvf pyqt-gpl-5.5.1.tar.gz

CD pyqt-gpl-5.5.1

python3.5 configure.py--qmake ~/workshop/qt5.5.1/5.5/clang_64/bin/qmake--disable=qtpositioning-d/Library/ Frameworks/python.framework/versions/3.5/lib/python3.5/site-packages

Make

sudo make install

--qmake option to develop the path of qmake, you need to modify your own, but also compiled with the compilation option disable-qtpositioning, if not, there will be a compilation error

If your program needs to use this module, you can create a new header file yourself, 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 development environment

In terminal, knock down the following code, if there is no error indicates that the installation was successful.

Python3.5-c "Import PyQt5"

Used in Pycharm.

Pycharm is now the most popular Python IDE, from JetBrains company, they also have other very good IDE, interested can go to try. Download address Https://www.jetbrains.com/pycharm/?fromMenu, install complete, open Preferences->project interpreter Choose the Python3.5.1 we just installed, Click OK.

Reference documents

Http://www.qt.io

http://www.pythonschool.net/pyqt/installing-pyqt-on-mac-os-x/

http://blog.15-cm.com/2015/09/13/pyqt5-pycharm/

Http://pyqt.sourceforge.net/Docs/PyQt5/installation.html#co-existence-with-pyqt4

Related Article

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.