1

When I try to deploy my Django rest API with Heroku I get this:

-----> Python app detected
       Using supported version of Python 3.6 (python-3.6.6)
-----> Installing python-3.6.6
-----> Installing pip
-----> Installing SQLite3
-----> Installing requirements with pip
       Collecting Python==3.5.1 (from -r /tmp/build_eff222df1413c9c747fe9d073117baf7/requirements.txt (line 1))
         Could not find a version that satisfies the requirement Python==3.5.1 (from -r /tmp/build_eff222df1413c9c747fe9d073117baf7/requirements.txt (line 1)) (from versions: )
       No matching distribution found for Python==3.5.1 (from -r /tmp/build_eff222df1413c9c747fe9d073117baf7/requirements.txt (line 1))
 !     Push rejected, failed to compile Python app.
 !     Push failed

How can I set my requirements.txt for this to work?, I used a virtual env, where I installed this:

django, 
djangorestframework, 
django-rest-auth, 
django-filter, 
django-cors-headers, 

I'm using python 3.5, and django 2.0.1

2 Answers 2

3

a common practice for deploying Python applications is to put the Python version into the runtime.txt file, not requirements.txt.

If you remove the line python==3.5.0 from requirements.txt and create a file runtime.txt with the contents python-3.5.0, does your app stage properly?

Sign up to request clarification or add additional context in comments.

1 Comment

You were right, i just wasnt pushing the changes correctly
0

It looks like you have put Python in your requirements.txt file. Don't do that.

If you really need to change the Python version from 3.6 to 3.5, you need to put that in runtime.txt, not requirements.txt. But there really shouldn't be any reason to do that at all. Stick with the default version.

1 Comment

This is the thing, i deleted python from requirements.txt, but the error still the same, it seems heroku doesnt update the changes,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.