使用nexus 3,我使用“ https://pypi.org ”作为远程存储配置了一个代理python存储库。存储库的 url 是“ http://localhost:8081/repository/pypi/ ”。
然后我曾经pip使用nexus存储库安装软件包,$HOME/.config/pip/pip.conf我有以下配置:
[global]
index = http://localhost:8081/repository/pypi/pypi
index-url = http://localhost:8081/repository/pypi/stable
trusted-host = localhost
Run Code Online (Sandbox Code Playgroud)
现在当我运行时pip search pexpect它工作正常:
User for localhost:8081: someuser
Password:
pexpect (4.7.0) - Pexpect allows easy control of interactive console applications.
pexpect-serial (0.0.4) - pexpect with pyseriat
...
Run Code Online (Sandbox Code Playgroud)
但是当我运行时pip install pexpect出现以下错误:
Collecting pexpect
User for localhost:8081: someuser
Password:
Could not find a version that satisfies the requirement pexpect (from versions: )
No matching distribution found for pexpect
Run Code Online (Sandbox Code Playgroud)
pip.conf我的nexus存储库中或内部是否需要额外配置?
Cli*_*ntm 11
你应该改变这个:
[global]
index = http://localhost:8081/repository/pypi/pypi
index-url = http://localhost:8081/repository/pypi/stable
trusted-host = localhost
Run Code Online (Sandbox Code Playgroud)
对此(交换stable为simple):
[global]
index = http://localhost:8081/repository/pypi/pypi
index-url = http://localhost:8081/repository/pypi/simple
trusted-host = localhost
Run Code Online (Sandbox Code Playgroud)
作为替代方案,您可以安装软件包而不修改配置:
如果您的 Nexus PyPi 存储库是http://localhost:8081/repository/pypi/:
# To install, mind trailing /simple
pip install -i http://localhost:8081/repository/pypi/simple pexpect
# To search, mind trailing /pypi
pip search -i http://localhost:8081/repository/pypi/pypi pexpect
Run Code Online (Sandbox Code Playgroud)
来源:Nexus 文档
| 归档时间: |
|
| 查看次数: |
3482 次 |
| 最近记录: |