Home > python > pip — The repository located at ‘some-ip’ is not a trusted or secure host and is being ignored.

pip — The repository located at ‘some-ip’ is not a trusted or secure host and is being ignored.

Problem:
When using pip to install a package from a local devpi-server, as the connection is not over Https the command fails to install. Instead one has to explicitly identify the local devpi-server as trusted.

Having devpi-server running off a https connection is an exercise for another day.

Solution:

$ pip install gunicorn
Collecting gunicorn
  The repository located at 192.168.38.18 is not a trusted or secure host and is being ignored. If this r
epository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this w
arning and allow it anyways with '--trusted-host 192.168.38.18'.
  Could not find a version that satisfies the requirement gunicorn (from versions: )
No matching distribution found for gunicorn

$ pip install gunicorn --trusted-host 192.168.38.18
Collecting gunicorn
  Downloading http://192.168.38.18:3141/root/pypi/+f/718/4b9d57eb92d01/gunicorn-19.4.5-py2.py3-none-any.w
hl (112kB)
    100% |████████████████████████████████| 122kB 105kB/s
Installing collected packages: gunicorn
Successfully installed gunicorn-19.4.5

Instead of having to type in `–trusted-host 192.168.38.18` every time you use pip, update your ~/.pip/pip.conf to be as follows

[global]
index-url = http://192.168.38.18:3141/root/pypi/+simple/
trusted-host = 192.168.38.18
Advertisements
Categories: python
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: