我有一个棘手的项目可以抓取数据并保存到mongodb。我想将其部署到 Heroku。
我从Scrapy官方网站 https://support.scrapinghub.com/support/solutions/articles/22000216178-scrapy-cloud-vs-scrapyd-using-heroku 参考-
我添加要求.txt:
pymongo==3.5.1
Scrapy==1.4.0
scrapyd==1.0.1
scrapy-heroku==0.7.1
刮.cfg:
[settings]
default = MyMovies.settings
[scrapyd]
application = scrapy_heroku.app.application
[deploy]
#url = http://localhost:6800/
url = http://moviescrapy.herokuapp.com:80/
project = MyMovies
username = <My Heroku account>
password = <My Heroku password>
文件:
web: scrapyd
在终端上键入git push heroku master
时。
我终于得到错误:
remote: AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
remote:
remote: ----------------------------------------
remote: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-oj017as5/distribute/
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to moviescrapy.
remote:
To https://git.heroku.com/moviescrapy.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/moviescrapy.git'
我想我已经遵循了官方教程,为什么我仍然收到错误?
我应该在某处添加distribute
吗?
我错过了哪一步? 任何帮助将不胜感激。提前谢谢。
这是因为 scrapy-heroku 不支持 python-3,而是使用 python-2 作为环境。