Installing python modules for specific version on linux (pySide)

吃可爱长大的小学妹 提交于 2019-12-23 05:01:05

问题


So, to keep it simple. Ubuntu 12.10 has python 3.2 pre installed and it is linked to "python3". I downloaded python 3.3 and it's command is "python3.3". However, I downloaded pySide for python3 from synaptic. Using "from PySide.QtCore import *" fails on python3.3. BUT, when I ran just "python3" (aka 3.2) everything works fine. Synaptic just installed lib for python3.2 which is default for python3 in ubuntu. How can I force synaptic to install modules for python3.3?

Thanks


回答1:


Try working in a virtual environment with virtualenv. This will keep your python versions/packages separate from each other in case something goes wrong. Use pip to install PySide.

EDIT:

A possible solution is:

~$ sudo easy_install pip

To install virtualenv,

~$ sudo pip install virtualenv

The page for PySide on PyPi has a guide for different platforms on how to install pyqt with virtualenv. Best of luck.




回答2:


I think you should install the pyside from its source files that have setup.py and then run the command python3.3 setup.py build and sudo python3.3 setup.py install because if you install by apt for example, it will use the default interpreter which is 3.2 that you mentioned.



来源:https://stackoverflow.com/questions/13895763/installing-python-modules-for-specific-version-on-linux-pyside

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!