Nexus pypi存储库“找不到满足要求的版本”

时间:2019-07-17 09:51:09

标签: python pip nexus

使用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

现在,当我运行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
...

但是当我运行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

我是否需要在pip.confnexus存储库中进行额外的配置?

2 个答案:

答案 0 :(得分:1)

您应该更改此设置:

[global]
index = http://localhost:8081/repository/pypi/pypi
index-url = http://localhost:8081/repository/pypi/stable
trusted-host = localhost

对此(将{{1}交换为stable):

simple

答案 1 :(得分:0)

或者,您可以安装软件包而无需修改配置:

如果您的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

来源:Nexus docs