python – Ghost.py没有找到PySide?

我正在尝试在Mac上开始使用
Ghost.py无头浏览器.我使用这些链接/命令安装了Ghost.py及其依赖项:

> Qt 5.0.1 for Mac,有一个GUI安装程序
> PySide 1.1.0,需要Qt版本> = 4.7.4,具有GUI安装程序
> sudo pip安装Ghost.py

我启动了Python,并确认我可以导入PySide.但是,当我从ghost导入Ghost时,它无法找到PySide:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ghost/__init__.py", line 1, in <module>
    from ghost import Ghost
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ghost/ghost.py", line 28, in <module>
    raise Exception("Ghost.py requires PySide or PyQt")
Exception: Ghost.py requires PySide or PyQt

通过导入PySide;打印PySide;,似乎PySide安装在我的系统上:/Library/Python/2.7/site-packages/PySide.所以,像这样追加PYTHONPATH:
export PYTHONPATH = $PYTHONPATH:/Library/Python/2.7/site-packages#for PySide.

但是,Ghost.py仍然找不到PySide.

我如何说服Ghost.py找到我的PySide安装?

环境:

> Mac OS X 10.7.5
> Python 2.7
> Qt 5.0.1
> PySide 1.1.0

最佳答案 我遇到了完全相同的问题,但设法修复它.方法如下:

>在系统上卸载当前的PySide和qt安装.确保/Library/Python/2.7/site-packages中不存在PySide.
>从http://qt-project.org/wiki/PySide_Binaries_MacOSX开始安装qt和PySide.

PS:我的系统运行10.9(小牛队),但我认为它应该在10.7(Mountain Lion)中运行.

点赞