使用Pip 1.5安装外部未经验证的软件包

时间:2014-05-12 11:32:34

标签: python django pip packaging package-managers

我正在尝试使用pip 1.5.5在Ubuntu 14.04上使用Python 2.7.6安装django-admin-tools 0.5.1。

我第一次尝试:

$ pip install django-admin-tools==0.5.1
Downloading/unpacking django-admin-tools==0.5.1
  Could not find a version that satisfies the requirement django-admin-tools==0.5.1 (from versions: 0.4.0)
  Some externally hosted files were ignored (use --allow-external to allow).
Cleaning up...
No distributions matching the version for django-admin-tools==0.5.1
Storing debug log for failure in /tmp/tmpd5Tb2I

'pip help install'处的文档说:

 --allow-external <package>  Allow the installation of externally hosted files

尝试启用该标志:

$ pip install --allow-external django-admin-tools==0.5.1                                                                                                                 
You must give at least one requirement to install (see "pip help install")

这很奇怪。经过一点修改后,我发现外部包URL不是https(setup.py)。所以我尝试使用标记--allow-unverified

$ pip install --allow-external --allow-unverified django-admin-tools==0.5.1                                                                                              
Downloading/unpacking django-admin-tools==0.5.1
  Could not find a version that satisfies the requirement django-admin-tools==0.5.1 (from versions: 0.4.0)
  Some externally hosted files were ignored (use --allow-external to allow).
Cleaning up...
No distributions matching the version for django-admin-tools==0.5.1
Storing debug log for failure in /tmp/tmpoT1_tW

我使用它错了吗?如何解决这个问题并使用pip安装django-admin-tools?

3 个答案:

答案 0 :(得分:6)

尝试调用:

pip install django-admin-tools==0.5.1 --allow-external django-admin-tools --allow-unverified django-admin-tools

答案 1 :(得分:3)

--allow-unverified--allow-external都将包名称作为参数。

From pip help install:
--allow-external <package>   Allow the installation of a package even if it
                             is externally hosted
--allow-unverified <package> Allow the installation of a package even if it 
                             is hosted in an insecure and unverifiable way

所以你的用法应该是

pip install <pkg> --allow-unverified <pkg> --allow-external <pkg>

或者有点混乱:

pip install --allow-unverified <pkg> --allow-external <pkg> <pkg>

答案 2 :(得分:0)

我找到了解决方案:

$ pip install django-admin-tools==0.5.1 --allow-unverified django-admin-tools

相关错误报告#1814 - pip