gpt4 book ai didi

python - 无法使用 Pip 安装任何包

转载 作者:行者123 更新时间:2023-12-01 04:02:29 24 4
gpt4 key购买 nike

每当我运行命令 pip install Django 时我收到以下错误跟踪,这意味着存在一些版本冲突。我尝试卸载然后安装相同的软件包,但它抛出了相同的错误。

Downloading/unpacking bcrypt (from Django)
Downloading bcrypt-2.0.0.tar.gz
Running setup.py (path:/tmp/pip_build_root/bcrypt/setup.py) egg_info for package bcrypt
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/bcrypt/setup.py", line 226, in <module>
**keywords_with_side_effects(sys.argv)
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 225, in __init__
_Distribution.__init__(self,attrs)
File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 257, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2029, in require
working_set.resolve(self.dist.requires(self.extras),env,installer))
File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 592, in resolve
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (certifi 2016.2.28 (/usr/local/lib/python2.7/dist-packages), Requirement.parse('certifi==2015.11.20'))
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 17, in <module>

File "/tmp/pip_build_root/bcrypt/setup.py", line 226, in <module>

**keywords_with_side_effects(sys.argv)

File "/usr/lib/python2.7/distutils/core.py", line 111, in setup

_setup_distribution = dist = klass(attrs)

File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 225, in __init__

_Distribution.__init__(self,attrs)

File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__

self.finalize_options()

File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 257, in finalize_options

ep.require(installer=self.fetch_build_egg)

File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2029, in require

working_set.resolve(self.dist.requires(self.extras),env,installer))

File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 592, in resolve

raise VersionConflict(dist,req) # XXX put more info here

pkg_resources.VersionConflict: (certifi 2016.2.28 (/usr/local/lib/python2.7/dist-packages), Requirement.parse('certifi==2015.11.20'))

----------------------------------------
Cleaning up...

我正在使用Python 2.7。有人知道是什么问题吗?

最佳答案

似乎所有问题都是由于 certifi 版本冲突

所以尝试从这里下载源代码 https://pypi.python.org/pypi/certifi

并从源安装

将其解压到文件夹中并运行此命令

sudo python setup.py  install

它应该可以工作

和平

关于python - 无法使用 Pip 安装任何包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36245599/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com