How do you configure pypi under Windows?

aquil.abdullah picture aquil.abdullah · May 6, 2013 · Viewed 10.6k times · Source

On my Mac, *nix based systems I configure pip by modifying the files:

  • ~/.pypirc
  • ~/.pip/pip.conf

The documentation that I've found so far, says that under windows you need to set the HOME environment variable and place the files in:

  • %HOME%\.pypirc
  • %HOME%\pip\pip.conf

However, this doesn't seem to work for me and when I try to use pip to install a package from one of our alternate servers the package can't be found. Any suggestions?

Links I've found so far

Answer

Petri picture Petri · Sep 20, 2016

The pip configuration docs at PyPA tell you to use a pip.ini file stored either:

  1. Globally at C:\ProgramData\pip\ (Win7 and up), or
  2. per-user at %HOME%\pip\ or
  3. per-virtualenv at the virtualenv root

In case of multiple pip.ini files, per-user settings override global settings. See the docs for more details.