Pregunta

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

¿Fue útil?

Solución 5

I wasn't able to pip to use my mirror repos auto-magically just by setting up my configuration files, but I was able to use the repositories by using the -i option:

pip install -i http://url.to.my.repository package_name

Otros consejos

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.

I was trying to work out where to put .pypirc on my Windows installation and the answer was C:\Users\YourName\.pypirc. Thanks Ernst Haagsman https://blog.jetbrains.com/pycharm/2017/05/how-to-publish-your-package-on-pypi/

I had a problem with this in Windows using setup.py. Getting the error:

ValueError: <repository> not found in .pypirc

From this I found that distutils only uses ~/.pypirc. And so you need to make the file %USERPROFILE%/.pypirc.

the easiest way to locate the folder is by running the following command in the cmd.

pip config -v list

That will result with the paths that pip is searching in to find the config file.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top