我是Python新手。我在ubuntulinux上安装了Scrapy。当我运行Scrapy shell
时,我得到这个错误
File "/home/user/.local/lib/python3.10/site-packages/scrapy/downloadermiddlewares/retry.py", line 25, in <module>
from twisted.web.client import ResponseFailed
File "/home/user/.local/lib/python3.10/site-packages/twisted/web/client.py", line 24, in <module>
from twisted.internet.endpoints import HostnameEndpoint, wrapClientTLS
File "/home/user/.local/lib/python3.10/site-packages/twisted/internet/endpoints.py", line 63, in <module>
from twisted.python.systemd import ListenFDs
File "/home/user/.local/lib/python3.10/site-packages/twisted/python/systemd.py", line 18, in <module>
from attrs import Factory, define
ModuleNotFoundError: No module named 'attrs'
我也已经运行了命令
python3.10 -m pip install attrs
pip install attrs
结果
默认为用户安装,因为常规站点包不可写。已满足要求:/usr/lib/python3/dist-packages中的属性(21.2.0)
1条答案
按热度按时间a64a0gku1#
几天前,我也面临着同样的问题,而试图运行我的scraperspider在linux服务器上,然后我想通了运行我的scrapy蜘蛛在一个虚拟环境内。希望它也将为您工作。:)