ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

python – 使用私有devpi服务器与pipenv

2019-07-10 16:08:10  阅读:252  来源: 互联网

标签:python pip pipenv devpi


我可以使用私有的本地devpi服务器使用pip安装我的软件包.相应的配置是:

[global]
index_url = http://mydevpi.mine/root/pypi/+simple/

[search]
index = http://mydevpi.mine/root/pypi/

[install]
trusted-host = mydevpi.mine

然后用pip安装很简单:

pip install -r requirements.txt

但是对pipenv做同样的事情似乎并不奏效.这有效,但没有使用我的本地devpi:

[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

这不起作用:

[[source]]

url = "http://devpi.dgv/root/pypi/+simple/"
verify_ssl = true
name = "pypi"

我如何告诉pipenv使用另一个url作为pypi?

解决方法:

也许,我可以澄清一点,因为我遇到了类似的问题.没有错误消息,但我看到很多流量到pypi.org(此流量是不需要的)

我在我的hosts文件中屏蔽了pypi.org并想强制使用我的devpi服务器,但是,pipenv安装失败了.

Current constraints:
  ipykernel

Finding the best candidates:

INFO:pip9._vendor.requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 10.56.0.120
INFO:pip9._vendor.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): wiki.pm1a.com
INFO:pip9._vendor.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): pypi.org
WARNING:pip9._vendor.requests.packages.urllib3.connectionpool:Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip9._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000002D74F344518>: Failed to establish a new connection: [WinError 10061] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte',)': /simple/ipykernel/
INFO:pip9._vendor.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (2): pypi.org
WARNING:pip9._vendor.requests.packages.urllib3.connectionpool:Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip9._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000002D74F344B00>: Failed to establish a new connection: [WinError 10061] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte',)': /simple/ipykernel/
INFO:pip9._vendor.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (3): pypi.org
WARNING:pip9._vendor.requests.packages.urllib3.connectionpool:Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip9._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000002D74F33EB70>: Failed to establish a new connection: [WinError 10061] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte',)': /simple/ipykernel/
INFO:pip9._vendor.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (4): pypi.org
WARNING:pip9._vendor.requests.packages.urllib3.connectionpool:Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip9._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000002D74F33E438>: Failed to establish a new connection: [WinError 10061] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte',)': /simple/ipykernel/
INFO:pip9._vendor.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (5): pypi.org
WARNING:pip9._vendor.requests.packages.urllib3.connectionpool:Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip9._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000002D74F33E208>: Failed to establish a new connection: [WinError 10061] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte',)': /simple/ipykernel/
INFO:pip9._vendor.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (6): pypi.org
Traceback (most recent call last):
  File "e:\python3\lib\site-packages\pipenv\vendor\pip9\_vendor\requests\packages\urllib3\connection.py", line 142, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "e:\python3\lib\site-packages\pipenv\vendor\pip9\_vendor\requests\packages\urllib3\util\connection.py", line 98, in create_connection
    raise err
  File "e:\python3\lib\site-packages\pipenv\vendor\pip9\_vendor\requests\packages\urllib3\util\connection.py", line 88, in create_connection
    sock.connect(sa)

我猜,它与github上的以下问题密切相关:https://github.com/pypa/pipenv/issues/1783

编辑:
看起来像运行pipenv安装–skip-lock解决了在运行devpi(或类似的东西)而无法访问pypi.org时的问题.这对我来说至少是解决方案(使用pipenv 11.10.0和python 3.6.4)

标签:python,pip,pipenv,devpi
来源: https://codeday.me/bug/20190710/1425798.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有