简体   繁体   中英

Python 2.7 PIP install to use Artifactory as proxy

I have configured Jfrog Artifactory as remote repo for PIP module. When I install the pexcept module on Centos 7 OS, its downloading using the Artifactory proxy, but its giving below error message. Also it trying to connect https://pypi.python.org/pypi/pip/json website.

Any tips to fix below error? Also How can I force pip command to use always internal Artifacotry proxy not to connect any external repo directly.

Requirement already satisfied (use --upgrade to upgrade): ptyprocess>=0.5 in /usr/lib/python2.7/site-packages (from pexpect)
Installing collected packages: pexpect
  Compiling /tmp/pip-build-bKzDu5/pexpect/pexpect/_async.py ...
    File "/tmp/pip-build-bKzDu5/pexpect/pexpect/_async.py", line 20
      transport, pw = yield from asyncio.get_event_loop()\
                               ^
  SyntaxError: invalid syntax


Successfully installed pexpect-4.7.0
Cleaning up...
Looking up "https://pypi.python.org/pypi/pip/json" in the cache
No cache entry available
Starting new HTTPS connection (1): pypi.python.org
There was an error checking the latest version of pip
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pip/utils/outdated.py", line 126, in pip_version_check
    headers={"Accept": "application/json"},
  File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 487, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python2.7/site-packages/pip/download.py", line 378, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 585, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.py", line 46, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py", line 467, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /pypi/pip/json (Caused by NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f5c16190d10>: Failed to establish a new connection: [Errno 97] Address family not supported by protocol',))

remote site setting:

在此处输入图像描述

I am presently using artifactory for just this purpose. I did find that some packages did not resolve well. After changing to https://files.pythonhosted.org as the registry URL everything just fell into place.

my other settings are

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM