Installing PySide on Mac: is there a working method?

前端 未结 6 1603
离开以前
离开以前 2021-02-06 08:06

I may be doing something wrong, but I have been trying to install pyside on Mac 10.12 (Sierra). Here is what I tried (after installing Qt with brew):

  • With the prec
6条回答
  •  梦毁少年i
    2021-02-06 08:31

    The Mac steps from here worked for me: https://fredrikaverpil.github.io/2016/08/17/compiling-pyside2/

    You’ll need the Xcode commandline tools:

    xcode-select --install
    sudo xcodebuild -license
    

    Then the following packages, easily installed via brew:

    brew install qt5 cmake libxslt libxml2
    

    Clone the pyside-setup repository and have it also pull down its gitmodules:

    git clone --recursive https://codereview.qt-project.org/pyside/pyside-setup
    

    Build it. This command worked fine for me using Python 2.7.11 and Python 3.5.1. Remember to have pip installed with the wheel package or you’ll get an error about bdist_wheel.

    cd pyside-setup
    python setup.py bdist_wheel --ignore-git --qmake=/usr/local/Cellar/qt5/5.6.1-1/bin/qmake --cmake=/usr/local/bin/cmake --openssl=/usr/local/Cellar/openssl/1.0.2h_1/bin
    

    Last but not least, install the wheel:

    cd dist
    pip install PySide2-2.0.0.dev0-cp27-cp27m-macosx_10_12_x86_64.whl
    

    All credits go to Fredrik Averpil's wonderful post.

提交回复
热议问题