简体   繁体   English

pip install --upgrade pip安装相同的版本

[英]pip install --upgrade pip installs the same version

Somehow pip --upgrade doesn't upgrade any packages. 不知怎的, pip --upgrade不升级任何包。

I'm on OSX El Capitan (10.11.3) and installed python using brew install python 我在OSX El Capitan(10.11.3)上并使用brew install python

Python: /usr/local/bin/python@ -> ../Cellar/python/2.7.11/bin/python Python: /usr/local/bin/python@ -> ../Cellar/python/2.7.11/bin/python
Pip: /usr/local/bin/pip@ -> ../Cellar/python/2.7.11/bin/pip /usr/local/bin/pip@ -> ../Cellar/python/2.7.11/bin/pip/usr/local/bin/pip@ -> ../Cellar/python/2.7.11/bin/pip

After successful install I run pip install --upgrade pip . 安装成功后,我运行pip install --upgrade pip

Full output: 全输出:

$ pip install --upgrade pip
Collecting pip
  Using cached pip-8.1.0-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-8.0.2
You are using pip version 8.0.2, however version 8.1.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Why doesn't pip install the new version? 为什么不用pip安装新版本?

Update 更新

I think it has something to do with my ~/.pydistutils.cfg file which fixes the DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both error when running pip . 我认为这与修复DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both ~/.pydistutils.cfg文件有关DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both运行pipDistutilsOptionError: must supply either home or prefix/exec-prefix -- not both错误。 I followed these instructions 我遵循了这些指示

Related SO question 相关的问题

$ sudo pip install -U pip
Collecting pip
Downloading pip-9.0.3-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 335kB/s 
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
  Successfully uninstalled pip-9.0.1
Successfully installed pip-9.0.3

Getting annoyed by things not working I created a new OSX profile. 由于无法正常工作而烦恼,我创建了一个新的OSX配置文件。 In the new profile everything was working fine so after investigating further I found a file ~/Library/Application\\ Support/pip/pip.conf in my main profile containing: 在新的配置文件中一切正常,所以在进一步调查后,我在主配置文件中找到了一个文件~/Library/Application\\ Support/pip/pip.conf ,其中包含:

[global]
target=/usr/local/lib/python2.7/site-packages

I don't know how it got there but removing it resolved the issue. 我不知道它是如何实现的,但删除它解决了这个问题。

This also resolved the need for the ~/.pydistutils.cfg file. 这也解决了对~/.pydistutils.cfg文件的需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM