【问题标题】:Installing PyQt4 for Python 3 mac为 Python 3 mac 安装 PyQt4
【发布时间】:2016-04-28 09:13:37
【问题描述】:

我无法让 PyQt4 与 Python 3 一起工作。我能够让 PyQt5 工作,但所有教程似乎都在使用 PyQt4 进行网络抓取,所以看起来我不得不使用 PyQt4。

我已按照

的指示进行操作
http://pyqt.sourceforge.net/Docs/PyQt4/installation.html 

但每当我进入“make install”部分时,所有内容都会复制到我的 Python 2.7 目录中,它适用于 Python 2.7。

我尝试设置目标目录

python3 configure.py -destdir/Users/ryan/anaconda/lib/python3.4/site-packages/

但它仍然安装到 python 2 目录。我也试过设置python版本

python3 configure.py --target-py-version 3.4

但它会返回

configure.py: error: no such option: --target-py-version

【问题讨论】:

    标签: python macos pyqt4


    【解决方案1】:

    您可以使用homebrew。安装 brew 后,只需在终端中输入以下命令:

    brew install sip --with-python3
    brew install pyqt --with-python3
    

    【讨论】:

    • 我安装了 Python 2.7/3.4/3.5,在删除 3.4 之后,我终于能够使用您的建议以及这篇文章 stackoverflow.com/questions/21711594/… 来完成这项工作
    • @RyanHalabi 很高兴听到。如果您认为答案有用,请点赞/接受会很好
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-19
    • 1970-01-01
    • 2016-08-05
    • 1970-01-01
    • 1970-01-01
    • 2020-12-12
    相关资源
    最近更新 更多