我已经在我的 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 软件包?
最佳答案
您需要easy_install3
。在 apt-get 中你可以通过
apt-get install python3-setuptools
关于Python、Ubuntu : Install PyPi package for a specific Python version,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19349644/