gpt4 book ai didi

python - 在 OS X El Capitan 上,我无法升级依赖于六个兼容性实用程序的 python 包,也不能删除六个

转载 作者:IT老高 更新时间:2023-10-28 21:50:46 31 4
gpt4 key购买 nike

我正在尝试使用刮,但我遇到了问题。

from six.moves import xmlrpc_client as xmlrpclib

ImportError: cannot import name xmlrpc_client

然后,我尝试了pip install --upgrade 六刮,但是:

  Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 311, in run
root=options.root_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 640, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 716, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 125, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 315, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)

OSError: [Errno 1] Operation not permitted: '/var/folders/3h/r_2cxlvd1sjgzfgs4xckc__c0000gn/T/pip-5h86J8-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

最佳答案

快速修复:

我刚刚解决了我认为相同的问题。你可以考虑试试这个(sudo,如有必要):

pip install scrape --upgrade --ignore-installed 六

Github最终我得到了这个答案(如果这个不能解决你的问题,你可以考虑更多的建议)。这似乎也是一个 El Capitan 问题。

此外,从技术上讲,这可能是 duplicate .但是另一篇文章给出的答案是安装自己的 Python,而不是依赖默认的 osx Python,这让我觉得更费力。


更长、更真实的修复:

最终我遇到了一种情况,我实际上需要升级 six 以安装其他一些库,此时忽略是不够的。对我来说升级 6 的最简单方法是不使用 pip,而是从 the six page 手动下载 .tar.gz ,解压,移动到新解压的六包目录,手动运行安装(sudo,必要时):

python setup.py install

感谢 this answer为指导。

关于python - 在 OS X El Capitan 上,我无法升级依赖于六个兼容性实用程序的 python 包,也不能删除六个,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33185147/

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