gpt4 book ai didi

python - 如何修复 ipython 安装 "Operation not permitted"错误?

转载 作者:太空宇宙 更新时间:2023-11-03 15:54:00 24 4
gpt4 key购买 nike

我尝试通过运行 sudo pip install ipython 来安装 ipython,但在 Mac OSX El Captain 10.11.6 中出现此错误。请帮忙。谢谢。

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/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
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/_markerlib/__init__.py', '/var/folders/qp/926rqdqj5jd7lpywngyh002h00c_zb/T/pip-N6qHvL-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', "[Errno 1] Operation not permitted: '/var/folders/qp/926rqdqj5jd7lpywngyh002h00c_zb/T/pip-N6qHvL-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', '/var/folders/qp/926rqdqj5jd7lpywngyh002h00c_zb/T/pip-N6qHvL-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', "[Errno 1] Operation not permitted: '/var/folders/qp/926rqdqj5jd7lpywngyh002h00c_zb/T/pip-N6qHvL-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', '/var/folders/qp/926rqdqj5jd7lpywngyh002h00c_zb/T/pip-N6qHvL-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', "[Errno 1] Operation not permitted: '/var/folders/qp/926rqdqj5jd7lpywngyh002h00c_zb/T/pip-N6qHvL-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', '/var/folders/qp/926rqdqj5jd7lpywngyh002h00c_zb/T/pip-N6qHvL-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', "[Errno 1] Operation not permitted: '/var/folders/qp/926rqdqj5jd7lpywngyh002h00c_zb/T/pip-N6qHvL-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', '/var/folders/qp/926rqdqj5jd7lpywngyh002h00c_zb/T/pip-N6qHvL-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', "[Errno 1] Operation not permitted: '/var/folders/qp/926rqdqj5jd7lpywngyh002h00c_zb/T/pip-N6qHvL-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib'")]

最佳答案

这种错误是众所周知的,事实上在OSX El Captain升级之后,很多用户普遍对pip有同样的问题,而不是针对特定的包。

如果您使用的是个人机器,可以尝试按以下方式安装:

sudo pip install --user ipython

--user 参数是最简单的解决方案。

让我知道它是否有效。

关于python - 如何修复 ipython 安装 "Operation not permitted"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40965495/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com