Strange behaviour with pip install

1.3k views Asked by At

I'm trying to install python dependencies through pip install. My environment doesn't have access to python default package index ( http://pypi.python.org ) for security reasons. But I have my own pypi server. The biggest problem is that, even setting the -i flag of pip install with my pypi server, pip install still looking for packages in python default package index. When this occurs, pip install can't reach the python default package index, and a connection time out occurs.

Here is the command line I'm running:

pip install --index-url http://custom.pypi.server/simple --trusted-host custom.pypi.server -r requirements.txt -vv

And here is the console output:

Starting new HTTPS connection (1): pypi.python.org
There was an error checking the latest version of pip
ConnectTimeout: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /pypi/pip/json (Caused by ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x153c3ed0>, 'Connection to pypi.python.org timed out. (connect timeout=5)'))
Getting page http://custom.pypi.server/simple/dependency/
Starting new HTTP connection (1): custom.pypi.server
"GET /simple/dependency/ HTTP/1.1" 200 277
Download error on https://pypi.python.org/simple/setuptools_git/: [Errno 110] Connection timed out -- Some packages may not be found!

For the direct dependency, pip install acts like a charm. But, for dependencies of my dependency ( setuptools_git ), pip install ignores the custom pypi server.

Can someone help me?

Thanks! :-)

1

There are 1 answers

0
smartxiaofish On
--disable-pip-version-check

Don't periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-index.