python, change user site directory or install setup.py --prefix with --user

雨燕双飞 提交于 2019-12-04 08:03:17

To answer your first question:

In Installing Python Modules guide written by Greg Ward we read:

Note that the various alternate installation schemes are mutually exclusive: you can pass --user, or --home, or --prefix and --exec-prefix, or --install-base and --install-platbase, but you can’t mix from these groups.

To answer your second question:

In the same guide there's section Alternate installation: the user scheme where we read:

Files will be installed into subdirectories of site.USER_BASE

with site.USER_BASE linked to https://docs.python.org/2/library/site.html#site.USER_BASE. There we are asked to see also information on PYTHONUSERBASE environment variable:

Defines the user base directory, which is used to compute the path of the user site-packages directory and Distutils installation paths for python setup.py install --user.

Also, you might be interested in the home scheme:

The idea behind the “home scheme” is that you build and maintain a personal stash of Python modules. This scheme’s name is derived from the idea of a “home” directory on Unix, since it’s not unusual for a Unix user to make their home directory have a layout similar to /usr/ or /usr/local/.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!