【问题标题】:Python, Ubuntu: Install PyPi package for a specific Python versionPython、Ubuntu:为特定 Python 版本安装 PyPi 包
【发布时间】:2013-10-21 09:26:32
【问题描述】:

我已经在我的 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 包?

【问题讨论】:

  • 我建议你使用pip over easy_install
  • @hcwhsa 是什么让它变得更好?
  • 您是否阅读了链接问题的答案?
  • 抱歉,以为它们是指向 pipeasy_install 网站的单独链接。会读的,谢谢。

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


【解决方案1】:

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

apt-get install python3-setuptools

【讨论】:

    猜你喜欢
    • 2017-06-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-21
    • 1970-01-01
    • 2021-12-21
    • 2016-12-03
    • 1970-01-01
    相关资源
    最近更新 更多