Pip不会安装pypi的最新可用版本(在这种情况下为argparse) [英] Pip doesn't install latest available version from pypi (argparse in this case)
问题描述
问题
我最近从事一些python项目,并且pip
在未安装某些要求的最新版本时遇到很多问题.我在osx
上,并且使用 brew 来安装Python 2.7.6
.在我正在研究的项目中,我们只是pip install -r requirements.txt
.在当前情况下,我需要安装argparse==1.2.1
.这是pypi网站上显示的实际最新版本
这是我的输出
Downloading/unpacking argparse==1.2.1 (from -r requirements.txt (line 4))
Could not find a version that satisfies the requirement argparse==1.2.1 (from -r requirements.txt (line 4)) (from versions: 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.8.0, 0.9.0, 0.9.1, 1.0.1, 1.0, 1.1)
Some externally hosted files were ignored (use --allow-external to allow).
Cleaning up...
No distributions matching the version for argparse==1.2.1 (from -r requirements.txt (line 4))
我对不同的要求有类似的问题,例如matplotlib
,我在在此处手动安装了该软件. /p>
如您所见,我的Mac上的pip仅具有那些argparse版本:0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.8.0, 0.9.0, 0.9.1, 1.0.1, 1.0, 1.1
尝试修复
我尝试使用brew reinstall python
重新安装python,然后还尝试使用一些xargs魔术方法重新安装所有已安装的python软件包:pip freeze | xargs -I {} sudo pip install {} --upgrade --force-reinstall
.
在尝试重新安装所有内容时,我遇到了大多数软件包的问题:error: invalid command 'egg_info'
.我发现我有一个旧的setuptools
,所以我pip install --upgrade setuptools
现在可以重新安装所有内容,但是argparse
仍然存在相同的问题. argparse仍然是同样的问题.
我向一个刚安装了osx的朋友问到 我尝试在osx上使用 和voilà:) 正如彼得所指出的,最新版本的点子 我认为这行是关键: 一些外部托管的文件被忽略(使用--allow-external允许). 当我在这里安装argparse时,我会得到 您正在安装外部托管的文件. pip的未来版本将默认不允许外部托管文件. 正在下载argparse-1.2.1.tar.gz(69kB):已下载69kB 因此您有一个更新版本的pip,默认情况下不允许外部托管文件 I worked on some python projects lately and had lots of problems with Here's my output I had similar problems with different kinds of requirements such as As you can see, pip on my mac only has those argparse versions: I tried reinstalling python with While trying to reinstall everything, I had trouble with most of the packages: I asked a friend with a freshly installed osx to To continue working on the project, I installed argparse 1.1 on osx and it seems to work fine atm for what I'm working on. I'm not very good with pypi (yet), but is-there any reason why I'm not getting the latest versions shown on pypi? Sounds like not all the libs on pypi are available for osx. Is there a way to know version availability for different os? argparse I tried to use and voilà :) As pointed out by Peter, latest version of pip I think this line is the key: Some externally hosted files were ignored (use --allow-external to allow). When I install argparse here I get You are installing an externally hosted file. Future versions of pip will default to disallowing externally hosted files. Downloading argparse-1.2.1.tar.gz (69kB): 69kB downloaded So you have a newer version of pip that is disallowing externally hosted files by default 这篇关于Pip不会安装pypi的最新可用版本(在这种情况下为argparse)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!pip install argparse
,他得到了1.1
,所以我设置了precise32
--allow-external
,但没有意识到它需要再次使用软件包的名称. sudo pip install argparse --allow-external argparse --upgrade
argparse an externally hosted file and may be unreliable
Downloading/unpacking argparse from http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz#md5=2fbef8cb61e506c706957ab6e135840c
Downloading argparse-1.2.1.tar.gz (69kB): 69kB downloaded
default to disallowing externally hosted files
.
The problem
pip
not installing the latest versions of some requirements. I am on osx
and and I used brew to install Python 2.7.6
. In the project I'm working on, we simply pip install -r requirements.txt
. In the current case, I needed to install argparse==1.2.1
. This is the actual latest version shown on the pypi websiteDownloading/unpacking argparse==1.2.1 (from -r requirements.txt (line 4))
Could not find a version that satisfies the requirement argparse==1.2.1 (from -r requirements.txt (line 4)) (from versions: 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.8.0, 0.9.0, 0.9.1, 1.0.1, 1.0, 1.1)
Some externally hosted files were ignored (use --allow-external to allow).
Cleaning up...
No distributions matching the version for argparse==1.2.1 (from -r requirements.txt (line 4))
matplotlib
which I installed manually as seen here.0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.8.0, 0.9.0, 0.9.1, 1.0.1, 1.0, 1.1
Attempts to fix
brew reinstall python
, then also tried to reinstall all of my installed python packages with some xargs magic: pip freeze | xargs -I {} sudo pip install {} --upgrade --force-reinstall
.error: invalid command 'egg_info'
. I figured out I had an old setuptools
so I pip install --upgrade setuptools
and I could now reinstall everything, but still, same problem with argparse
. Still the same problem with argparse.pip install argparse
and he got 1.1
So I've setup a precise32
vagrant box for a clean ubuntu install with python-dev
+ libevent-dev
and had no trouble at all installing argparse==1.2.1
.Temp fix
Questions
Edit: solution inside
1.1
seems to be the same as 1.2.1
as shown on this outputvagrant@precise32:~$ python
Python 2.7.3 (default, Sep 26 2013, 20:08:41)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import argparse
>>> argparse.__version__
'1.1'
>>> quit()
vagrant@precise32:~$ pip freeze | grep argparse
argparse==1.2.1
--allow-external
on osx, but did not realize it needed the name of the package again. sudo pip install argparse --allow-external argparse --upgrade
argparse an externally hosted file and may be unreliable
Downloading/unpacking argparse from http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz#md5=2fbef8cb61e506c706957ab6e135840c
Downloading argparse-1.2.1.tar.gz (69kB): 69kB downloaded
default to disallowing externally hosted files
.