Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip not working

I am trying to install python-shapely with pip in Ubuntu 10.04. I got "Unknown or unsupported command 'install'" while I tried,

user@desktop:~$ pip install Shapely

I tried installing pip and got the following error:

user@desktop:~$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  python-pip
0 upgraded, 1 newly installed, 0 to remove and 396 not upgraded.
Need to get 0B/49.8kB of archives.
After this operation, 270kB of additional disk space will be used.
(Reading database ... 252574 files and directories currently installed.)
Unpacking python-pip (from .../python-pip_0.3.1-1ubuntu2.1_all.deb) ...
dpkg: error processing /var/cache/apt/archives/python-pip_0.3.1-1ubuntu2.1_all.deb (--unpack):
 trying to overwrite '/usr/bin/pip', which is also in package pip 0:0.13-1
Errors were encountered while processing:
 /var/cache/apt/archives/python-pip_0.3.1-1ubuntu2.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I'd appreciate any comment/solution.

Thanks!

like image 363
troublemaker Avatar asked Nov 04 '11 17:11

troublemaker


People also ask

Why pip is not installing?

One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.

How do I run pip?

Ensure you can run pip from the command lineRun python get-pip.py . 2 This will install or upgrade pip. Additionally, it will install setuptools and wheel if they're not installed already. Be cautious if you're using a Python install that's managed by your operating system or another package manager.


2 Answers

Did you install pip first, then get this error, then try to install python-pip?

If so, first remove pip (apt-get remove pip), then install python-pip instead and try again.

(I just had the same problem, not sure if python 2.7 uses pip and 2.6 uses python-pip? That might be the issue.)

like image 137
Demelziraptor Avatar answered Nov 15 '22 17:11

Demelziraptor


Same happen to me, I'm running Ubuntu Lucid Lynx, 10.04 and there's a packaging conflict. Package pip (pearl installation software) has a conflict with the python-pip package. Both of them try to put a pip binary at /usr/bin/pip. You could do several things to solve the problem so choose the one that fits your needs:

1.- Remove "the pearl pip" if you don't use it and install the python pip

2.- Force installation of python pip with some "dpkg -f" or so, but this way your pip binary file will be overwritten

3.- Manually install ether of the packages changing the binary name, i.e. you manually install the python pip and instead of pip you just call the binary "python-pip"

like image 31
marcog Avatar answered Nov 15 '22 16:11

marcog