Python PyQt on macOS Sierra

前端 未结 6 1330
忘了有多久
忘了有多久 2020-12-08 15:18

How can I get to work PyQt 4 or 5 on a Mac with OS X Sierra? It seems that I have to wait for a new version of PyQt but I am not sure if that is actually true.

6条回答
  •  Happy的楠姐
    2020-12-08 15:36

    I managed to get Qt5 with PyQt5 installed (on both 10.10.5 and 10.12) using these steps, which I learned from https://gist.github.com/guillaumevincent/10983814:

    1. Install Xcode (required by Qt5 installer)
    2. Install Python 3 from https://www.python.org/downloads/ (includes pip3 command)
    3. Install Qt5 from https://www.qt.io/
    4. Install SIP (pip3 install SIP)
    5. Install PyQt (pip3 install PyQt5)

    This also made commands such as pyuic5 available in Terminal.app (requires re-opening the Terminal window once to recognize the new search paths).

提交回复
热议问题