簡體   English   中英

Scrapy推送到Heroku會出現錯誤:推送被拒絕,無法編譯Python應用

[英]Scrapy push to Heroku get error: Push rejected, failed to compile Python app

我的scrapy項目可以抓取數據並保存到mongodb。 我想將其部署到Heroku。

我從Scrapy官方網站https://support.scrapinghub.com/support/solutions/articles/22000216178-scrapy-cloud-vs-scrapyd-using-heroku-

我添加了requirements.txt:

pymongo==3.5.1
Scrapy==1.4.0
scrapyd==1.0.1
scrapy-heroku==0.7.1

scrapy.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>

Procfile:

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作為環境。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM