pip - python, change user site directory or install setup.py --prefix with --user -
i'd want install python modules non-root user this
$ pip install -i --install-option="--prefix=~/usr" scipy
unfortunately not work unless specify --user
. --user
can't used --prefix
. using --user
(without --prefix
) installs ~/.local
find ugly because have maintained ~/usr
, don't want add more stuff env
make ~/.local
usable too.
so questions:
- how can let
--prefix
,--user
work setup.py or how else setup.py succeed without using--user
? - or can change user site directory
~/.local
~/usr
somehowenv
?
to answer first question:
in installing python modules guide written greg ward read:
note various alternate installation schemes mutually exclusive: can pass --user, or --home, or --prefix , --exec-prefix, or --install-base , --install-platbase, can’t mix these groups.
to answer second question:
in same guide there's section alternate installation: user scheme read:
files installed subdirectories of
site.user_base
with site.user_base
linked https://docs.python.org/2/library/site.html#site.user_base. there asked see information on pythonuserbase
environment variable:
defines user base directory, used compute path of user site-packages directory , distutils installation paths python setup.py install --user.
also, might interested in the home scheme:
the idea behind “home scheme” build , maintain personal stash of python modules. scheme’s name derived idea of “home” directory on unix, since it’s not unusual unix user make home directory have layout similar /usr/ or /usr/local/.
Comments
Post a Comment