Morton
Morton

Reputation: 5780

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

I have s scrapy project can crawl data and save to mongodb. I want to deploy it to Heroku.

I take a reference from Scrapy official website https://support.scrapinghub.com/support/solutions/articles/22000216178-scrapy-cloud-vs-scrapyd-using-heroku-

I add 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

When type git push heroku master on terminal.

I get the error finally:

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'

I think i have follow the official tutorial, why i still get the error ?

Should i add distribute somewhere ?

What step i miss it ? Any help would be appreciated. Thanks in advance.

Upvotes: 0

Views: 281

Answers (1)

Shubham Jain
Shubham Jain

Reputation: 26

It's because scrapy-heroku does not support python-3 instead use python-2 as a environment.

Upvotes: 1

Related Questions