How to set up a third-party mirror for pip

Published on Aug. 22, 2023, 12:16 p.m.

To set up a third-party mirror for pip, you can use the following steps:

  1. Create a file called pip.conf in your home directory if it doesn’t already exist.
  2. Add the following lines to the pip.conf file:
[global]
index-url = https://<mirror_url>/simple/

Replace <mirror_url> with the URL of the mirror you want to use.

  1. Save the pip.conf file.

After setting up the mirror, pip will prioritize packages from the mirror you added. You can test if the mirror is working by running pip install <package_name>.

Note that some mirrors require authentication or have specific configurations. Please refer to the documentation of the mirror you choose for more information.

Tags:

pip