如何解决scrapinghub部署失败“可调用”没有属性“ _abc_registry”
我正在尝试使用以下命令将scrapy项目部署到scrapinghub:
shub deploy 470662
版本:
- Scrapy版本2.2.1
- shub版本2.11.0
- python3.8
它会产生以下错误:
/usr/local/lib/python3.8/site-packages/setuptools/distutils_patch.py:25: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.
warnings.warn(
Packing version 1.0
Deploying to Scrapy Cloud project "470662"
Deploy log last 30 lines:
File "/app/python/lib/python3.8/site-packages/scrapy/http/__init__.py",line 15,in <module>
from scrapy.http.response import Response
File "/app/python/lib/python3.8/site-packages/scrapy/http/response/__init__.py",line 7,in <module>
from typing import Generator
File "/app/python/lib/python3.8/site-packages/typing.py",line 1359,in <module>
class Callable(extra=collections_abc.Callable,metaclass=CallableMeta):
File "/app/python/lib/python3.8/site-packages/typing.py",line 1007,in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
Traceback (most recent call last):
File "/usr/local/bin/shub-image-info",line 8,in <module>
sys.exit(shub_image_info())
File "/usr/local/lib/python3.8/site-packages/sh_scrapy/crawl.py",line 200,in shub_image_info
from scrapy.exceptions import ScrapyDeprecationWarning
File "/app/python/lib/python3.8/site-packages/scrapy/__init__.py",line 12,in <module>
from scrapy.spiders import Spider
File "/app/python/lib/python3.8/site-packages/scrapy/spiders/__init__.py",line 10,in <module>
from scrapy.http import Request
File "/app/python/lib/python3.8/site-packages/scrapy/http/__init__.py",in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
{"message": "shub-image-info exit code: 1","details": null,"error": "image_info_error"}
{"status": "error","message": "Internal error"}
Deploy log location: /var/folders/rp/xxjnjsvn70g2ndh68l0g10bh0000gn/T/shub_deploy_6h9fra1k.log
Error: Deploy failed: b'{"status": "error","message": "Internal error"}'
这是requirements.txt
和scrapinghub.yml
requirements.txt:
itemadapter==0.1.0
requests==2.23.0
Scrapy==2.2.1
scrapy-user-agents==0.1.1
scrapy-rotating-proxies==0.6.2
scrapinghub.yml
:
projects:
default: 470662
requirements:
file: requirements.txt
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。