MAC OS X Yosemite PyQt4 configuration record by Tsy

Source: Internet
Author: User
Tags qt designer

MAC OS X Yosemite PyQt4 configuration record by Tsy

Statement:

1) this report by the blog Park Bitpeach Write, copyright, free reprint, please specify the source, and do not for commercial purposes.

2) If there are any infringing text or images in this document, please contact the author Bitpeach delete the appropriate section.

3) the contents of this document relate to Mac OS X Yosemite of the PyQt4 configuration.

4) For reference purposes only, do not use as evidence to prove the purpose, please make your own choice, verify the reference.

0 Catalog 1.1 Reference documents

Mainly summarizes, I refer to read some of the literature. Take this as a solid foundation, to practice. These reference blogs or articles are a very valuable record of experience.

1.2 Environment

What to prepare

1.3 process steps

PyQt4 some of the process steps for configuration

1.4 End

about the PyQt4 the actual use of some simple idea records

1 references 1.1 causes

python has recently written a system, but needs to implement the interface. Originally wanted to use MFC or C #, for various reasons, decided to abandon it. to Qt, and then think about the final decision PyQt, as practiced hand.

Each person's operating environment is different, the detail conditions are different, although the approximate key steps are similar, but the details are different, sometimes making some configurations fail. The details of each person's attempts are different, how to achieve the correct operation under their own actual conditions, but also a transformation.

In the repeated attempts to think of what should be recorded, because the memory is limited, sometimes write a write, avoid forgetting, but also for the exploration of the back of a good lesson.

1.2 Literature Description

The most reliable of the few, as follows. But some of the details are not the same, and the previous attempt to fail may also be relevant.

" 1 " http://blog.csdn.net/yxmmxy7913/article/details/6163397

how the Apple system (Mac OS X) installed on PyQt4

" 2 " http://www.pythoner.cn/home/blog/mac-os-x-lion-pyqt/

MAC OS X 10.7 Lion Configuration under System PyQt Development Environment

" 3 " http://www.cnblogs.com/zouzf/p/4308912.html

Pqt4 Learning One: setting up the environment and getting started

" 4 " http://blog.csdn.net/watsy/article/details/8857252

PyQt4 for Mac OS 10.8

2 Environment 2.1 system

MAC OS X Yosemite version 10.10.3 ( - bit)

2.2 software preparation

What are the uses of the following software, documentation 2 The explanation is very clear. Read the software description of document 2 , the dependence between the software, more enlightened.

" 1 " Qt

Address Reference: http://www.qt.io/download-open-source/#section-2

It is important to note that Qt5.4.1 have put Creator and the Library no need to follow the documentation 2 and look for other Qt the installation library.

so just download the link to the right:? Qt 5.4.1 for Mac (598 MB) (info)

" 2 " SIP

Address Reference: Http://www.riverbankcomputing.co.uk/software/sip/download

So download the link below:

Sip-4.16.7.tar.gz

Linux, UNIX, macos/x source

" 3 " PyQt4

Address Reference: Http://www.riverbankcomputing.co.uk/software/pyqt/download

So download the link below:

Pyqt-mac-gpl-4.11.3.tar.gz

macos/x Source

3 steps 3.1 Qt installation

Click on the dmg installation.

3.2 SIP installation

the author all the later terminal commands are Root permission to execute, although some cock silk, but do not want to waste too much energy to lose password.

1) Open Terminal, Open Root permission to enter Tar package directory, using the command decompression.

TAR-ZXVF Sip-4.16.7.tar

This is illustrated below:

2) Enter the extracted folder, detect the installation platform features, instructions for

python configure.py

worth mentioning, did not follow the literature 1 , Literature 3 , Literature 4 said, using the specified + bit or - -bit compilation. The reason is that this step does not make the system bit conversion, and finally configured the PyQt4.

This is illustrated below:

3) compile and install, instructions for

Make

The illustration shows the image above and the second Red arrow.

The final compilation is completed and installed.

Make install

The picture doesn't have to be given.

3.3 PyQt4 installation

1) the same with PyQt of the Tar Package Decompression, command-similar.

TAR-ZXVF Pyqt-mac-gpl-4.11.3.tar

This is illustrated below:

2) detects target platform features, unlike before, because the Qt Write environment variables, some PyQt need to Qt the library was compiled and therefore could not be found. So you need to specify the feature in the directive. The instruction can be:

python configure-ng.py-q/users/ his actual name. /qt5.4.1/5.4/clang_64/bin/qmake-d/library/python/2.7/site-packages/--sip/system/library/frameworks/ Python.framework/versions/2.7/bin/sip

be aware that the specified Qmake at compile time, the path replaces its own actual situation. When you specify a python library, the path replaces its actual python location. sip in the same vein.

As shown below, you can see that not specifying a feature will cause a failure. The Red Arrows are entered correctly.

3) to compile and install.

Execute first

Make

Final execution can

Make install

Literature 1 also shows that the compilation takes a certain amount of time, the author's compilation process about the minutes.

The illustrations are:

4) The final verification, the literature are introduced. You can open the terminal and enter python. And then execute

From PYQT4 import Qtcore, Qtgui

If you do not have any problems, you should configure success.

5) I like it better . qt Designer interface Control operation, so if you find an qt Designer .

Please use Ctrl + Space Open Spotlight , the search key is Designer , so we find the app .

Noteworthy is not what the literature says qt Designer , it will not be searched.

As for how to configure Eric4 , I think it would be a relatively simple matter.

4 end 4.1 thinking

Previously configured once and failed. The problems at that time were:

1. I have configured non-system-brought python, environment variables are not well written

2.SIP Compilation failed

3. do not install Qt in time

Now the configuration is successful, it may also be related to the reference document.

4.2 PyQt4

Personal comparison tendency qt Designer control Drag-and-drop interface authoring method, this aspect of the information is relatively small. If there is a video or article, it must be a few. Control Click Drag and drop the way relatively simple and rough, suitable for people who do not make the software interface beautification reference. PyQt4 also inherits the benefits of Qt 's interface code from the business code, which is really simple and elegant.

MAC OS X Yosemite PyQt4 configuration record by Tsy

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.