如何在我的mac上卸载pip包?

时间:2018-01-17 09:55:42

标签: python macos numpy pip uninstall

我正在尝试运行以下命令来卸载我的mac上的pip包:

pip freeze | xargs sudo pip uninstall -y

(即使使用sudo -H标志,也不起作用)

pip freeze给出了以下pip安装包列表:
同时按下AltGraph == 0.10.2
bdist-MPKG == 0.5.0
beautifulsoup4 == 4.5.3
Bonjour的PY == 0.3
CERTIFI == 2017年11月5日
chardet的== 3.0.4
认知面== 1.3.1
莳萝== 0.2.7.1
Django的== 1.11.6
djangorestframework == 3.7.1
filemapper == 0.1.3
未来== 0.16.0
IDNA == 2.6
拐点== 0.3.1
LXML == 3.7.2
macholib == 1.5.1
matplotlib == 1.3.1
modulegraph == 0.10.4
更itertools == 4.0.1
NDG-httpsclient == 0.4.3
n元语法== 1.0.3
NLTK == 3.2.2
numpy的== 1.8.0rc1
py2app == 0.7.3
pyasn1 == 0.4.2
pygame的== 1.9.3
pyobjc核心== 2.5.1
pyobjc框架-账户== 2.5.1
pyobjc框架,通讯录2.5.1 ==
pyobjc框架-AppleScriptKit == 2.5.1
pyobjc框架-AppleScriptObjC == 2.5.1
pyobjc框架-的Automator == 2.5.1
pyobjc框架,CFNetwork的== 2.5.1
pyobjc框架,可可== 2.5.1
pyobjc框架,协作== 2.5.1
pyobjc框架-CoreData == 2.5.1
pyobjc框架-CoreLocation == 2.5.1
pyobjc框架,CoreText == 2.5.1
pyobjc框架-DictionaryServices == 2.5.1
pyobjc框架-EventKit == 2.5.1
pyobjc框架-ExceptionHandling == 2.5.1
pyobjc框架-FSEvents == 2.5.1
pyobjc框架-InputMethodKit == 2.5.1
pyobjc框架-InstallerPlugins == 2.5.1
pyobjc框架-InstantMessage == 2.5.1
pyobjc框架-LatentSemanticMapping == 2.5.1
pyobjc框架-LaunchServices == 2.5.1
pyobjc框架-消息== 2.5.1
pyobjc框架-OpenDirectory == 2.5.1
pyobjc框架-PREFERENCEPANES == 2.5.1
pyobjc框架,PubSub的== 2.5.1
pyobjc框架-QTKit == 2.5.1
pyobjc框架石英== 2.5.1
pyobjc框架屏保== 2.5.1
pyobjc框架-ScriptingBridge == 2.5.1
pyobjc框架-SearchKit == 2.5.1
pyobjc框架-ServiceManagement == 2.5.1
pyobjc框架,社会== 2.5.1
pyobjc框架 - SyncServices == 2.5.1
pyobjc框架-SystemConfiguration == 2.5.1
pyobjc框架,WebKit的== 2.5.1
pyOpenSSL == 0.13.1
pyparsing == 2.0.1
蟒-dateutil == 1.5
pytz == 2013.7
请== 2.18.4
scikit学习== 0.19.1
SciPy的== 0.13.0b1
SimpleCV == 1.3
6 == 1.4.1
sklearn == 0.0返回
urllib3 == 1.22
XATTR == 0.6.4
zope.interface == 4.1.1

使用pip freeze | xargs sudo pip uninstall -y,我得到以下结果:

Uninstalling altgraph-0.10.2:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/uninstall.py", line 76, in run
    requirement_set.uninstall(auto_confirm=options.yes)
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 346, in uninstall
    req.uninstall(auto_confirm=auto_confirm)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move
    copytree(src, real_dst, symlinks=True)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 208, in copytree
    raise Error, errors
Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/__init__.py', '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/__init__.py', "[Errno 1] Operation not permitted: '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/__init__.pyc', '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/__init__.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/Dot.py', '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/Dot.py', "[Errno 1] Operation not permitted: '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/Dot.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/Dot.pyc', '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/Dot.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/Dot.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/Graph.py', '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/Graph.py', "[Errno 1] Operation not permitted: '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/Graph.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/Graph.pyc', '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/Graph.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/Graph.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphAlgo.py', '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphAlgo.py', "[Errno 1] Operation not permitted: '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphAlgo.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphAlgo.pyc', '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphAlgo.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphAlgo.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphStat.py', '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphStat.py', "[Errno 1] Operation not permitted: '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphStat.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphStat.pyc', '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphStat.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphStat.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphUtil.py', '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphUtil.py', "[Errno 1] Operation not permitted: '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphUtil.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphUtil.pyc', '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphUtil.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/GraphUtil.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/ObjectGraph.py', '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/ObjectGraph.py', "[Errno 1] Operation not permitted: '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/ObjectGraph.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/ObjectGraph.pyc', '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/ObjectGraph.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph/ObjectGraph.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph', '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph', "[Errno 1] Operation not permitted: '/tmp/pip-YANgl9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/altgraph'")]

它只停止在第一个包中卸载,甚至不移动到其他包。我尝试使用pip uninstall <package-name>单独卸载软件包,它仍然无法正常工作,并且每次都给出相同的错误语句序列。
我不知道我在哪里弄错了。我想重置所有pip安装包以启动新包并从头开始安装所需的包。

有人可以帮帮我吗?

1 个答案:

答案 0 :(得分:0)

我试图重现错误,我认为你应该传递参数['=transpose(\'Form Responses 1\'!J2:O2)'] 来提及每一行的第一个块。 否则,请尝试检查它是否不是特定于您的包的问题