Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python-- cannot find pip.ini

Tags:

python

pip

I'm not able to get PIP to install python-imaging-tk. I get the following error:

pip-could-not-find-any-downloads-that-satisfy-the-requirement

Some other users have posted about this before, and the problem seems to be that my pip.ini file is looking at http://pypi.python.org/simple/ rather than https://pypi.python.org/simple/ . All I need to do is edit the url in pip.ini, but I can't find it. I've tried:

C:\Users\jon\pip  ...and...  C:\Users\jon\AppData\Local\pip

Where should I look for the .ini file?

like image 317
Jonathan Brouwer Avatar asked Mar 18 '23 06:03

Jonathan Brouwer


2 Answers

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

pip config -v list

That will give you the paths that pip is searching in to find the config file. It is possible that there is no pip.ini file in there. Then you have to create it.

like image 155
George Sotiropoulos Avatar answered Mar 28 '23 18:03

George Sotiropoulos


As https://pip.pypa.io/en/latest/user_guide.html explains:

  • On Unix the default configuration file is: $HOME/.config/pip/pip.conf which respects the XDG_CONFIG_HOME environment variable.
  • On Mac OS X the configuration file is $HOME/Library/Application Support/pip/pip.conf.
  • On Windows the configuration file is %APPDATA%\pip\pip.ini.

Looks like you're on Windows, so just

echo %AppData%

at a command prompt, and that should tell you what you need to know.

like image 35
Alex Martelli Avatar answered Mar 28 '23 18:03

Alex Martelli