分享

Mac Install PyQt 4 (not 5)

 dzh1121 2016-03-14
Using brew


brew install pyqt    (会自动安装dependency)


但是,安装完毕后, 运行

$ brew test pyqt  

没有问题

实际import PyQt4的时候还是找不到


运行$brew info pyqt
发现:

Phonon support is broken.

Python modules have been installed and Homebrew's site-packages is not
in your Python sys.path, so you will not be able to import the modules
this formula installed. If you plan to develop with these modules,
please run:
  mkdir -p /Users/Tiger/Library/Python/2.7/lib/python/site-packages
  echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/Tiger/Library/Python/2.7/lib/python/site-packages/homebrew.pth

运行了上面2行命令之后, 发现可以在python 2.7中运行了。

但是3.5中依然不行。

因此更改为:

  echo 'import site; site.addsitedir("/usr/local/lib/python3.5/site-packages")' >> /Users/Tiger/Library/Python/3.5/lib/python/site-packages/homebrew.pth

依然不行。
最后还是下载的源代码自己编译安装的。

from riverbank (Qt4)

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多