pip-setting

pip install localtion can be modified

command to find the default position

1
python -m site

be careful the USER_SITE value, it stores the package location pip installed

now let us to see where is the config file

1
python -m site --help

the config file is /usr/lib/python3.8/site.py

then we change the default value to

1
USER_SITE = "/home/narcissus/Software/python_lib"

from now on, we use pip command install packages, they will be stored in customized position

example:

1
pip install pandas --user

but the defalut localtion (~/.local/lib/python3.8/site-packages) is good enough, so i don’t change it.