使用自制软件安装的模块的Python导入错误

使用自制软件安装的模块的Python导入错误,python,installation,pip,packages,pyside,Python,Installation,Pip,Packages,Pyside,我已经使用自制软件安装了PySide,但是当我的脚本运行诸如 from PySide import QtWebKit 当我尝试brew install pyside时,我收到一个错误,该错误已安装pyside-1.2.0 当我尝试pip安装pyside时,出现以下错误: In file included from /Users/fitvalet/wgwt/env/build/pyside/sources/pyside/plugins/customwidgets.cpp:23: /Users/

我已经使用自制软件安装了PySide,但是当我的脚本运行诸如

from PySide import QtWebKit
当我尝试
brew install pyside
时,我收到一个错误,该错误已安装
pyside-1.2.0

当我尝试
pip安装pyside
时,出现以下错误:

In file included from /Users/fitvalet/wgwt/env/build/pyside/sources/pyside/plugins/customwidgets.cpp:23:

/Users/fitvalet/wgwt/env/build/pyside/sources/pyside/plugins/customwidget.h:27:10: fatal error: 'QtDesigner/QtDesigner' file not found

fatal error: 'QtDesigner/QtDesigner' file not found

#include <QtDesigner/QtDesigner>

     ^

2 warnings and 1 error generated.

make[2]: *** [plugins/CMakeFiles/uiplugin.dir/customwidgets.cpp.o] Error 1

make[1]: *** [plugins/CMakeFiles/uiplugin.dir/all] Error 2

make: *** [all] Error 2

error: Error compiling pyside

...

Command /Users/fitvalet/WGWT/env/bin/python -c 
"import setuptools;__file__='/Users/fitvalet/WGWT/env/build/pyside/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" 
install --record /var/folders/rb/qjx8psqs3gj48qmpgbqqvrhc0000gn/T/pip-h69ltB-record/install-record.txt --single-version-externally-managed --install-headers 
/Users/fitvalet/WGWT/env/include/site/python2.7 failed with error code 1 in 
/Users/fitvalet/WGWT/env/build/pyside
Storing complete log in /Users/fitvalet/.pip/pip.log

我通过重新安装PySide的自制安装解决了这个问题

当您使用自制软件安装时,会收到以下警告:

For non-homebrew python (2.x), you need to amend your PYTHONPATH like so:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH 
运行这个模块,模块工作了


为了使更改自动进行,而不是每次打开新的终端控制台时都必须键入该行,我需要将该行添加到我的./bash_配置文件中。

Do
pip install pyside
刚刚尝试了它,但仍然得到相同的错误-我不确定pip是否正确安装了它?
For non-homebrew python (2.x), you need to amend your PYTHONPATH like so:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH