简体   繁体   English

配置pip以从pypi.python.org获取丢失的软件包

[英]configure pip to get missing package from pypi.python.org

I have local pypi server. 我有本地pypi服务器。

and I set it configuration in 然后在

root@localhost$ cat .pip/pip.conf
[global]
index-url = http://localhost/simple
trusted-host=localhost

My pypi server has paste=2.0.2 but one of the app need paste=2.0.3 . 我的pypi服务器具有paste=2.0.2但是其中一个应用程序需要paste=2.0.3 when I check in https://pypi.python.org/simple/paste/ it has this version. 当我签入https://pypi.python.org/simple/paste/它具有此版本。

When I run pip install -r requirements.txt it gives below error. 当我运行pip install -r requirements.txt时,出现以下错误。

Collecting paste==2.0.3 (from -r requirements.txt (line 22))
  1 location(s) to search for versions of paste:
  * http://localhost/simple/paste/
  Getting page http://localhost/simple/paste/
  Resetting dropped connection: localhost
  "GET /simple/paste/ HTTP/1.1" 200 309
  Analyzing links from page http://localhost/simple/paste/
    Found link http://localhost/packages/Paste-2.0.2-py2-none-any.whl#md5=42d3df8ad533457607903a0ca0922825 (from http://localhost/simple/paste/), version: 2.0.2
  Could not find a version that satisfies the requirement paste==2.0.3 (from -r requirements.txt (line 22)) (from versions: 2.0.2)
Cleaning up...
No matching distribution found for paste==2.0.3 (from -r requirements.txt (line 22))
Exception information:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 335, in run
    wb.build(autobuilding=True)
  File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
    require_hashes
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 276, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/local/lib/python2.7/dist-packages/pip/index.py", line 514, in find_requirement
    'No matching distribution found for %s' % req
DistributionNotFound: No matching distribution found for paste==2.0.3 (from -r requirements.txt (line 22))
You are using pip version 9.0.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

How can I configure pip.conf , so when specific package with number is not available on local pypi, it will search for pypi.python.org ? 我如何配置pip.conf ,所以当local pypi上没有带编号的特定软件包时,它将搜索pypi.python.org

You need to set 你需要设置

[global]
extra-index-url =  https://pypi.python.org

in your ~/.pip/pip.conf file per the documentation 根据文档在〜/ .pip / pip.conf文件中

Furthermore, you can start you pypi server with the following argument 此外,您可以使用以下参数启动pypi服务器

  --fallback-url FALLBACK_URL
    for packages not found in the local index, this URL will be used to
    redirect to (default: http://pypi.python.org/simple)

暂无
暂无

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

相关问题 curl https://pypi.python.org/simple/pip不返回任何内容 - curl https://pypi.python.org/simple/pip returns nothing 从本地文件夹进行安装时,PIP防止连接到pypi.python.org - PIP Prevent connection to pypi.python.org while doing installation from local folder 当pip.conf指定其他位置时,为什么pip试图到达pypi.python.org? - Why is pip trying to reach pypi.python.org when pip.conf specifies elsewhere? 与pypi.python.org的连接超时 - Connection to pypi.python.org timed out 如何解决 ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443) with pip? - How to solve ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443) with pip? pip 连接失败:无法获取索引基 URL http://pypi.python.org/simple/ - pip connection failure: cannot fetch index base URL http://pypi.python.org/simple/ Python pip错误:“无法获取索引基URL https://pypi.python.org/simple/” - Python pip error: “Cannot fetch index base URL https://pypi.python.org/simple/” 我无法升级pip:无法获取URL https://pypi.python.org/simple/pip/:存在一个确认ssl证书的问题 - I can't upgrade pip: Could not fetch URL https://pypi.python.org/simple/pip/: There was a prόblem confirming the ssl certificate 为什么pypi.python.org/simple上有一些软件包,但是没有页面? - Why are some packages on pypi.python.org/simple, but have no page? 无法安装分发:pypi.python.org 拒绝 http - Cannot install distribute: pypi.python.org rejecting http
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM