Featured post
python - Combine --user with --prefix error with setup.py install -
i trying install python packages system gained access to. trying take advantage of python's relatively new per user site-packages directory, , new option --user
. (the option currently undocumented, exists python 2.6+; can see running python setup.py install --help
.)
when tried running
python setup.py install --user
on package downloaded, got following error:
error: can't combine user with prefix/exec_prefix/home or install_(plat)base
the error extremely perplexing because, can see, wasn't providing --prefix
, --exec-prefix
, --install-base
, or --install-platbase
flags command line options. wasted lot of time trying figure out problem was. document answer below, in hopes spare other poor soul few hours of yak shaving.
one time workaround:
pip install --user --install-option="--prefix=" <package_name>
or
python setup.py install --user --prefix=
note there no text (not whitespace) after =
.
do not forget --user
flag.
installing multiple packages:
create ~/.pydistutils.cfg
(or equivalent os/platform) following contents:
[install] prefix=
note there no text (not whitespace) after =
.
then run necessary pip install --user
or python setup.py install --user
commands. not forget --user
flag.
finally, remove or rename file. leaving file present cause issues when installing python packages system-wide (i.e., without --user
) user ~/.pydistutils.cfg
.
the cause of issue
this appears issue both opensuse , redhat, has lead a bug in virtualenv on these platforms.
the error stems system-level distutils configuration file (in case /usr/lib64/python2.6/distutils/distutils.cfg
) there this
[install] prefix=/usr/local
basically, equivalent running install command install --prefix=/usr/local
. have override specification using 1 of techniques above.
- Get link
- X
- Other Apps
Comments
Post a Comment