python+pip安装bson

2024-04-25 11:39:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我要安装第三个库->bson。 但是下一个错误,谁知道为什么?在

# pip install bson
Collecting bson
  Using cached bson-0.5.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-cP7YdW/bson/setup.py", line 8, in <module>
        from pip import get_installed_distributions
    ImportError: cannot import name get_installed_distributions

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-cP7YdW/bson/

系统信息:

^{pr2}$

python和pip版本信息:

# python -V
Python 2.7.13
# pip --version
pip 10.0.0 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

Tags: installpipinfrompyimportinfoegg
3条回答

请尝试pip install upgrade setuptools并再次运行。在

简易修复:

pip uninstall bson
pip uninstall pymongo
pip install pymongo

许多作者都没有受到警告。最后在版本10中,他们重新构造了代码。在

要继续对导入pip的包使用pip,您需要pip版本9:

python -m pip install -U 'pip>=9,<10'

注:已经有一个bug report。在

相关问题 更多 >

    热门问题