gpt4 book ai didi

Python pip 安装报错

转载 作者:太空狗 更新时间:2023-10-30 00:44:57 26 4
gpt4 key购买 nike

我使用 Homebrew 在 Mac OS X 上安装了 Python

$ brew install python

然后我尝试使用 pip 进行更新但出现错误:

$ which python
/usr/local/bin/python
$ python --version
Python 2.7.5
$ pip --version
pip 1.5.4 from /usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg (python 2.7)
$ pip install --upgrade distribute
Downloading/unpacking distribute
Downloading distribute-0.7.3.zip (145kB): 145kB downloaded
Running setup.py (path:/private/var/folders/87/wkgwm0754tn9csz8295qjmmc000bxz/T/pip_build_bdkk/distribute/setup.py) egg_info for package distribute

Downloading/unpacking setuptools>=0.7 from https://pypi.python.org/packages/3.4/s/setuptools/setuptools-3.4.4-py2.py3-none-any.whl#md5=46284205a95cf3f9e132bbfe569e1b9d (from distribute)
Downloading setuptools-3.4.4-py2.py3-none-any.whl (545kB): 545kB downloaded
Installing collected packages: setuptools, distribute
Found existing installation: setuptools 3.4.1
Uninstalling setuptools:
Successfully uninstalled setuptools
Rolling back uninstall of setuptools
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 1439, in install
requirement.rollback_uninstall()
File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 603, in rollback_uninstall
self.uninstalled.rollback()
File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/req.py", line 1855, in rollback
pth.rollback()
AttributeError: 'str' object has no attribute 'rollback'

Storing debug log for failure in /Users/bdkk/.pip/pip.log

有什么想法吗?

最佳答案

在尝试安装 distribute 之前单独升级 setuptools:

pip install --upgrade setuptools
pip install --upgrade distribute

关于Python pip 安装报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23276866/

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