pip搜索不适用于pypi存储库

时间:2019-04-05 10:30:43

标签: artifactory

我已经在Artifactory中设置了一个PyPi仓库,但是我无法使用pip搜索上传的软件包。

我在Artifactory中创建了一个PyPi仓库,并推送了一个示例程序包的两个版本,效果很好。该软件包及其两个版本已在Artifactory中以正确的仓库提供。运行pip搜索并尝试找到此软件包会导致超时。

上传软件包完全没有任何问题。

我也尝试过不使用/ simple。

pip search example -i http://artifactory_server/api/pypi/pypi-repo/simple

产生以下内容:

Exception:
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\pip\_internal\cli\base_command.py", line 179, in main
    status = self.run(options, args)
  File "c:\python27\lib\site-packages\pip\_internal\commands\search.py", line 48, in run
    pypi_hits = self.search(query, options)
  File "c:\python27\lib\site-packages\pip\_internal\commands\search.py", line 65, in search
    hits = pypi.search({'name': query, 'summary': query}, 'or')
  File "c:\python27\lib\xmlrpclib.py", line 1243, in __call__
    return self.__send(self.__name, args)
  File "c:\python27\lib\xmlrpclib.py", line 1602, in __request
    verbose=self.__verbose
  File "c:\python27\lib\site-packages\pip\_internal\download.py", line 823, in request
    headers=headers, stream=True)
  File "c:\python27\lib\site-packages\pip\_vendor\requests\sessions.py", line 581, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "c:\python27\lib\site-packages\pip\_internal\download.py", line 403, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "c:\python27\lib\site-packages\pip\_vendor\requests\sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\python27\lib\site-packages\pip\_vendor\requests\sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "c:\python27\lib\site-packages\pip\_vendor\requests\adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
ReadTimeout: HTTPConnectionPool(host='artifactory_server', port=80): Read timed out. (read timeout=15)

任何想法都受到欢迎。

谢谢。

1 个答案:

答案 0 :(得分:0)

由于您未使用https,因此需要在命令末尾添加以下选项 --trusted-host artifactory_server