在 linux (pySide) 上为特定版本安装 python 模块 [英] Installing python modules for specific version on linux (pySide)
问题描述
所以,保持简单.Ubuntu 12.10 预先安装了 python 3.2,并链接到python3".我下载了 python 3.3,它的命令是python3.3".但是,我从突触下载了 python3 的 pySide.在 python3.3 上使用from PySide.QtCore import *"失败.但是,当我只运行python3"(又名 3.2)时,一切正常.Synaptic 刚刚为 python3.2 安装了 lib,这是 ubuntu 中 python3 的默认值.如何强制突触为 python3.3 安装模块?
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?
谢谢
推荐答案
尝试使用 virtualenv 在虚拟环境中工作.这将使您的 python 版本/包彼此分开,以防出现问题.使用pip安装PySide.
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.
一个可能的解决方案是:
A possible solution is:
~$ sudo easy_install pip
要安装 virtualenv,
To install virtualenv,
~$ sudo pip install virtualenv
PyPi 上的 PySide 页面有一个关于如何安装 pyqt 的不同平台指南虚拟环境.祝你好运.
The page for PySide on PyPi has a guide for different platforms on how to install pyqt with virtualenv. Best of luck.
这篇关于在 linux (pySide) 上为特定版本安装 python 模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!