PIP: Install from private PyPi repository
A detailed comparison between RxJava and Reactor projects

  Jul 13, 2021 -   read
  software, programming, python, pip

When working in the corporate context, most of the time application packages / libraries will be hosted in a private repository that is managed by Nexus or other artifact management platforms. This short article will show you how to configure pip to install packages from private repositories (with authentication).

Install a package from the private PyPi repository:

$ pip install -i https://<repository-url> <package>
- or -
$ pip install -i https://<repository-url> -r requirements.txt

In case of the:

SSLError “SSL: CERTIFICATE_VERIFY_FAILED”
– or –
WARNING “The repository located at <repository-domain> is not a trusted or secure host and is being ignored.”

You can define a path to the CA bundle and install a package from the private PyPi repository as follows:

$ pip install --cert <path> \
              -i https://<repository-url> <package>
-or-
$ pip install --trusted-host <repository-domain> \
              -i https://<repository-url> <package>
-or-
$ pip install --trusted-host <repository-domain> \
              -i https://<user>:<pass>@<repository> <package>

The private PyPi repository settings can also be defined in /etc/pip.conf, for example:

[global]
index-url = https://username:[email protected]/simple
trusted-host = pypi.python.org
#cert = /etc/pki/ca-trust/source/ca-bundle.crt

:100:

Dang Chien
Software engineer, solution architect and Agile practitioner.
Do you find this article helpful ❤️ ? Support me with a coffee via paypal.me/ck1910, give me a shout out on Twitter at @dangchien87, or help to share this article instead.