pip --user by default

Abdur-Rahmaan Janhangeer arj.python at gmail.com
Tue Jan 16 01:57:27 EST 2018


another thing which amazed me with pip is that you can write

library1 == 1.2.7
library2 == 3.6.1

in requirements.txt

and pip install requirements.txt will install those libs

On 13 Jan 2018 17:16, "Thomas Jollans" <tjol at tjol.eu> wrote:

> Hi,
>
> I recently discovered the wonders of pip.conf: if I create a file
> ~/.config/pip/pip.conf* with:
>
> [install]
> user = true
>
> then pip will install to the --user site-packages by default, rather
> than trying to install packages into system directories.
>
> The trouble is that this fails when you also use virtualenvs. In a
> virtualenv, --user doesn't work, so pip fails when trying to install
> anything in a virtualenv as long as the user pip.conf contains those lines.
>
> Short of adding a pip.conf to every single virtualenv, is there any way
> to work around this, and configure pip to install packages
>
>  - into the user directories if possible
>  - into the environment when in an environment
>
> by default?
>
> Thanks,
> Thomas
>
>
>
> * the path obviously depends on the OS:
> https://pip.pypa.io/en/stable/user_guide/#config-file
> --
> https://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list