python - 导入错误 : No module named PySide

标签 python pyside

我已经在我的 Ubuntu 12.04 中安装了 PySide。当我尝试在 python 控制台中使用 import PySide 时,出现以下错误。

import PySide
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named PySide

我的 Python 路径是:

print sys.path ['', '/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PIL',
'/usr/lib/python2.7/dist-packages/gst-0.10',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/pymodules/python2.7',
'/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
'/usr/lib/python2.7/dist-packages/ubuntuone-client',
'/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
'/usr/lib/python2.7/dist-packages/ubuntuone-couch',
'/usr/lib/python2.7/dist-packages/ubuntuone-installer',
'/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']

如何解决这个问题?

最佳答案

要使用 python 3,只需按照此处的说明操作:

https://wiki.qt.io/PySide_Binaries_Linux

在 ubuntu 12.04 中意味着只需在控制台中输入一行:

sudo apt-get install python3-pyside

关于python - 导入错误 : No module named PySide,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27798829/

相关文章:

Python 因 Qt 绑定(bind)而挂起

css - 如何在 PySide 中使用样式表为整个小部件设置背景颜色

Python:下一个()函数

python - 将边界框中的pdf文本直接提取到python中

python - 长时间运行的 CPU 密集型 python 脚本被调度程序发送到 sleep 状态

python - PySide 代替 PyQt4 作为 matplotlib Qt4Agg 后端的先决条件

c++ - 在两个不同的程序之间发送/接收数据

python - login_required 装饰器给出 "object has no attribute ' user'"错误

python - setItemDelegateForColumn() 在没有堆栈跟踪的情况下使应用程序崩溃

python - setItemWidget 导致崩溃