Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 6005  / 2 Years ago, mon, may 23, 2022, 11:48:51

I've been having an odd problem with pip on Ubuntu 15.04. When I try to install anything using the "-t" option to put it in a specific directory, it fails with the following error:



error: can't combine user with prefix, exec_prefix/home, or install_(plat)base



For instance, pip install -t <directory> <package> fails with this error.



My pip is version 1.5.6, and my Python version is 2.7.



I've run the exact same commands on my 14.10 systems with no issues, so I can only conclude that this is a problem which is particular to 15.04.


More From » python

 Answers
7

I ran into the same problem and what I noticed is that the pip in the default distro is old 1.5.6 the current released version being 7.1.0. Since is hard to track down the issue, looking there and there for the "needle in a hay stack" I removed it and installed it manually as suggested in the following :



This comment : https://github.com/pypa/pip/issues/1093#issuecomment-103127883
referenced in this stack: https://stackoverflow.com/questions/19460232/pip-list-crashes-with-an-assertionerror



Remove pip:



sudo apt-get remove --auto-remove python-pip


Download the install script :



wget https://bootstrap.pypa.io/get-pip.py


Install it back:



sudo python get-pip.py


Link commands to bin :



sudo ln -s [PIP_HOME]/bin/pip /usr/local/bin/pip
sudo ln -s [PIP_HOME]/bin/wheel /usr/local/bin/wheel
sudo ln -s [PIP_HOME]/bin/easy_install /usr/local/bin/easy_install


Where [PIP_HOME] is the directory of the pip package.



now when I run pip -V puts out :



pip 7.1.0 from /home/tiberiu/.local/lib/python2.7/site-packages (python 2.7)


Back to my root problem the command pip install -r requirements.txt -t lib success with the newest version.


[#20139] Tuesday, May 24, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
guialk

Total Points: 300
Total Questions: 144
Total Answers: 121

Location: Saint Vincent and the Grenadines
Member since Sat, Sep 11, 2021
3 Years ago
;