【发布时间】:2014-02-17 10:10:59
【问题描述】:
当我在 Ubuntu 中输入以下命令时,它会显示所有 python 包列表:
$ 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)
当我导入一个特定的包时,它运行良好:
$ 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
>>>
但是当我尝试卸载特定包时,它会抛出如下错误:
$ sudo pip uninstall argparse
Can't uninstall 'argparse'. No files were found to uninstall.
为什么我会遇到上述问题?
【问题讨论】:
-
是使用 pip 还是使用您的发行版的包管理器安装了上述包(在您的示例中为 argparse)?不管用什么方法安装它,你都应该用同样的方法来卸载它。
-
你
sudo安装了那个包吗? -
@MatToufoutu 感谢您的回复。在包安装时,我没有使用 pip。但我现在需要卸载这些包。