Skip to content

Instantly share code, notes, and snippets.

@guillaumevincent
Last active October 28, 2023 12:05
Show Gist options
  • Star 52 You must be signed in to star a gist
  • Fork 17 You must be signed in to fork a gist
  • Save guillaumevincent/10983814 to your computer and use it in GitHub Desktop.
Save guillaumevincent/10983814 to your computer and use it in GitHub Desktop.
A simple guide to install PyQt5 on Mac OS X 10.9 (Maverick) and use python 3.4 on a virtualenv.

Guide to install PyQt5 on Mac OS X with python 3.4 virtualenv

Description

A simple guide to install PyQt5 on Mac OS X 10.9 (Maverick) and use python 3.4 on a virtualenv.

Requirements

  • xcode 5.1.1
  • python 3.4.0
  • Qt libraries 5.2.1
  • SIP 4.15.5
  • PyQt 5.2.1

Download

installation

  • install xcode
  • install the Command Line Tools (open Xcode > Preferences > Downloads)
  • install Qt libraries (qt-opensource-mac-x64-clang-5.2.1.dmg)
  • install python 3.4
  • create a virtual env (i.e. ~/.env/ariane_mail)
  • unzip and compile SIP and PyQt
    cd /var/tmp
    cp /Users/gvincent/Downloads/PyQt-gpl-5.2.1.tar.gz .
    cp /Users/gvincent/Downloads/sip-4.15.5.tar.gz .
    tar xvf PyQt-gpl-5.2.1.tar.gz
    tar xvf sip-4.15.5.tar.gz
    cd sip-4.15.5/
    python3 configure.py -d ~/.env/ariane_mail/lib/python3.4/site-packages --arch x86_64
    make
    sudo make install
    sudo make clean
    cd ../PyQt-gpl-5.2.1/
    python3 configure.py --destdir ~/.env/ariane_mail/lib/python3.4/site-packages --qmake ~/Qt5.2.1/5.2.1/clang_64/bin/qmake
    make
    sudo make install
    sudo make clean
    ~/.env/ariane_mail/bin/python -c "import PyQt5"
@tauruswang
Copy link

sip: Deprecation warning: /Users/jerryw/OpenSourceProjects/qtbuild/PyQt5_gpl-5.6/sip/QtCore/QtCoremod.sip:23: %Module version numbers are deprecated and ignored. I think it should use the sip 4.18. the link is http://pyqt.sourceforge.net/Docs/sip4/incompatibilities.html

@tauruswang
Copy link

commet the fjile sipQtCoreQt.cpp generated by the sip for the build QT version 5.10.0_1
//{sipName_WindowCancelButtonHint, static_cast(Qt::WindowCancelButtonHint), 418},
//{sipName_WindowOkButtonHint, static_cast(Qt::WindowOkButtonHint), 418},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment