pip not working

醉酒当歌 提交于 2020-01-02 00:40:09

问题


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!


回答1:


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.)




回答2:


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"




回答3:


Seems to be broken download. Did you try easy_install?

sudo easy_install pip



回答4:


The problem raise because pip is in strawberry perl and Python both, if Perl's pip hit this error comes

$ which pip /cygdrive/c/strawberry/perl/bin/pip

Solution 1. C:\Python27\Scripts\pip install south or 2. Keep python path before strawberry perl or 3. remove strawberry perl path from path variable...




回答5:


Leave everything, Install latest version of python from its https://www.python.org/downloads .It already contain PIP, so open CMD from start and give him path to reach folder where python is installed and open "Script" folder where pip is build-in installed e.g. c:\Python36-32\Script And then write pip install module_name and enjoy,,,

Possibly you will have to open Administrator CMD, SO after typing cmd in start when you see CMD is on list press CTRL+SHIFT+ENTER and press OK in pop-up dialog and you will have administrative CMD.



来源:https://stackoverflow.com/questions/8013581/pip-not-working

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