Python - cant find pip.ini or pip.conf in Windows

前端 未结 11 1986
谎友^
谎友^ 2021-01-31 07:57

I got Python 2.7.8 installed on my Win7 machine, which comes with pip already pre-installed.
I\'m successfully able to install new packages from pip and now I need to add c

11条回答
  •  生来不讨喜
    2021-01-31 08:20

    Pip changed the location of the config file in windows starting in pip 6.0 the pip config docs explain the location of the config files as follows.

    pip --version >= 6 (as of version 18.1 hasn't changed again yet)

    %APPDATA%\pip\pip.ini
    

    pip --version < 6

    %HOME%\pip\pip.ini
    

    Inside a virtual env

    %VIRTUAL_ENV%\pip.ini
    

    Site-wide win7+ (same as of win10)

    C:\ProgramData\pip\pip.ini
    

    Site-wide winxp (note windows vista side wide not supported)

    C:\Documents and Settings\All Users\Application Data\pip\pip.ini
    

    NOTE: If multiple configuration files are found by pip then they are combined in the following order:

    1. The site-wide file is read
    2. The per-user file is read
    3. The virtualenv-specific file is read

    Also pip added a config command starting in pip 10.

    pip config --help
    

提交回复
热议问题