gpt4 book ai didi

python - Scrapy 抛出 ImportError : cannot import name xmlrpc_client

转载 作者:IT老高 更新时间:2023-10-28 21:52:27 25 4
gpt4 key购买 nike

通过 pip 安装 Scrapy 并拥有 Python 2.7.10:

scrapy
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 7, in <module>
from scrapy.cmdline import execute
File "/Library/Python/2.7/site-packages/scrapy/__init__.py", line 48,
in <module>
from scrapy.spiders import Spider
File "/Library/Python/2.7/site-packages/scrapy/spiders/__init__.py",
line 10, in <module>
from scrapy.http import Request
File "/Library/Python/2.7/site-packages/scrapy/http/__init__.py", line
12, in <module>
from scrapy.http.request.rpc import XmlRpcRequest
File "/Library/Python/2.7/site-packages/scrapy/http/request/rpc.py",
line 7, in <module>
from six.moves import xmlrpc_client as xmlrpclib
ImportError: cannot import name xmlrpc_client

但我可以导入模块:

Python 2.7.10 (default, Jun 10 2015, 19:42:47) 
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import scrapy
>>>

发生了什么事?

最佳答案

我刚刚在我的 OS X 上解决了这个问题。

请先备份您的文件。

sudo rm -rf /Library/Python/2.7/site-packages/six*
sudo rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six*
sudo pip install six

Scrapy 1.0.0 已准备就绪。


如果遇到错误rm:/System/Library/... Operation not allowed

请尝试禁用System Integrity Protection
Operation Not Permitted when on root El capitan (rootless disabled)

关于python - Scrapy 抛出 ImportError : cannot import name xmlrpc_client,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30964836/

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