charles okojie
charles okojie

Reputation: 728

Heroku not reading requirement.txt file

I am trying to deploy my python flask app to heroku but it keeps crashing and complaining about bash: gunicorn: command not found. I have my requirement.txt file in the root folder where my Procfile is also located. My python code is located in src/server/

Procfile contains: web: gunicorn --pythonpath src/server/ route:app --preload

I have gunicorn in my requirements file:

Is there something i'm missing?

     gunicorn==19.8.1
     Flask==0.12.2
     Flask-Cache==0.13.1
     Flask-Cors==3.0.2
     Flask-MongoAlchemy==0.5.1
     flask-mongoengine==0.9.5
     Flask-PyMongo==0.5.2
     Flask-WTF==0.14.2
     gevent==1.2.1
     greenlet==0.4.12
     pymongo==3.6.1

folder structure;

enter image description here

enter image description here

Upvotes: 4

Views: 2356

Answers (3)

Kyle Polich
Kyle Polich

Reputation: 11

I am also having a similar problem like this on Heroku. I created an IDENTICAL new project and magically it works. Heroku has some bug related to ignoring requirements.txt

Upvotes: 1

charles okojie
charles okojie

Reputation: 728

I fixed it by creating a new environment in Heroku. The previous environment seems not to be reading the requirement.txt file, I couldn't figure why.

Upvotes: 0

unholy_me
unholy_me

Reputation: 460

I faced a similar problem with my app. I just reset all my requirements by sending in an empty requirements.txt file. Then built my app. Then sent the original file. I don't understand why, but it worked.

Upvotes: 2

Related Questions