My spider imports a package that is not in the Scrapy Cloud stack, and the job fails with an import error. How do I add it?
Asked and answered by the Zyte team, as a reference for the community.
My spider imports a package that is not in the Scrapy Cloud stack, and the job fails with an import error. How do I add it?
Asked and answered by the Zyte team, as a reference for the community.
List your dependencies in a requirements.txt in the project, and tell the deploy about it in scrapinghub.yml:
requirements:
file: requirements.txt
Then deploy again. The packages are installed into the project’s environment as part of the deploy.
A few related points.
Docs: Deploying code to Scrapy Cloud projects - Zyte documentation and Frequently Asked Questions about Scrapy Cloud - Zyte documentation