سؤال

When I type the following command in Ubuntu, it is showing all list of python packages:

$  sudo pip list
adium-theme-ubuntu (0.3.2)
apt-xapian-index (0.44)
apturl (0.5.1ubuntu3)
argparse (1.2.1)
BeautifulSoup (3.2.0)
Brlapi (0.5.6)
bzr (2.5.1)
chardet (2.0.1)
command-not-found (0.2.44)
dirspec (3.0.0)
distribute (0.7.3)
dnspython (1.9.4)
docutils (0.8.1)
duplicity (0.6.18)
gdata (2.0.14)
GnuPGInterface (0.3.2)
httplib2 (0.7.2)
jockey (0.9.7)
louis (2.3.0)
mercurial (2.0.2)
nvidia-common (0.0.0)
onboard (0.97.1)
oneconf (0.2.8.1)
PAM (0.4.2)
paramiko (1.7.7.1)
pexpect (2.3)
pip (1.4.1)
piston-mini-client (0.7.2)
Pmw (1.3.2)
psutil (0.4.1)
psycopg2 (2.4.5)
PyChart (1.39)
pycrypto (2.4.1)
pycups (1.9.61)
pycurl (7.19.0)
pydot (1.0.2)
pyinotify (0.9.2)
pyOpenSSL (0.12)
pyparsing (1.5.2)
pyserial (2.5)
pysmbc (1.0.13)
python-apt (0.8.3ubuntu7.2)
python-ldap (2.3.13)
python-openid (2.2.5)
python-virtkey (0.60.0)
pyxdg (0.19)
PyYAML (3.10)
reportlab (2.5)
sessioninstaller (0.0.0)
setuptools (0.8b2)
simplejson (2.3.2)
system-service (0.1.6)
Twisted-Core (11.1.0)
Twisted-Names (11.1.0)
Twisted-Web (11.1.0)
ubuntuone-couch (0.3.0)
ubuntuone-installer (3.0.2)
ubuntuone-storage-protocol (3.0.2)
ufw (0.31.1-1)
unattended-upgrades (0.1)
unittest2 (0.5.1)
unity-lens-video (0.3.5)
unity-scope-video-remote (0.3.5)
usb-creator (0.2.23)
uTidylib (0.2)
wsgiref (0.1.2)
xdiagnose (2.5.3)
xkit (0.0.0)
xlwt (0.7.2)
ZSI (2.1-a1)

When I import a particular package, it is working perfect:

$ sudo python
Python 2.7.3 (default, Sep 26 2013, 20:08:41) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import argparse
>>> 

But when I try to uninstall particular package, it throws an error like this:

$  sudo pip uninstall argparse
Can't uninstall 'argparse'. No files were found to uninstall.

Why I am facing above problem?

هل كانت مفيدة؟

المحلول

If you haven't used pip to install argparse (unlikely, as it is python core library), you don't use pip to uninstall it.

نصائح أخرى

For not-too-old python versions (python 2.7+), argparse is part of the python distribution, and therefore you can't uninstall it easily (and it's not a good idea to do this anyway).

As per the comments, there is a possibility to do this using easy_install -m and then deleting the .egg file.

Also afaik, you can't generally uninstall packages with pip that you haven't installed with pip. Use whatever you installed a package with, to uninstall it. Your package manager (apt-get) is one option here.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top