Python,Ubuntu:为特定的Python版本安装PyPi包

时间:2013-10-13 20:00:39

标签: python ubuntu python-3.3 easy-install pypi

我在我的Ubuntu机器上安装了Python 3.3和Python 2.75。问题是easy_install只获取默认的2.75版本的包,例如:

easy_install pymongo

$ python
Python 2.7.4 (default, Apr 19 2013, 18:28:01) 
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymongo
>>>

可是:

$ python3.3
Python 3.3.1 (default, Apr 17 2013, 22:30:32) 
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymongo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>

ImportError: No module named 'pymongo'

如何为Python 3.3安装安装PyPi包?

1 个答案:

答案 0 :(得分:3)

您需要easy_install3。在apt-get中你可以通过

获得它
apt-get install python3-setuptools