2

I installed django-user-visit with pip install django-user-visit , tested it in my local environment and everything seems to work fine, but when i try to deploy my app to production with Heroku i get the following error :

remote:        Collecting django-cors-headers==3.6.0
remote:          Downloading django_cors_headers-3.6.0-py3-none-any.whl (12 kB)
remote:        ERROR: Could not find a version that satisfies the requirement django-user-visit==0.4.1 (from -r /tmp/build_940d12d0/requirements.txt (line 4)) (from versions: none)
remote:        ERROR: _No matching distribution_ found for django-user-visit==0.4.1 (from -r /tmp/build_940d12d0/requirements.txt (line 4))
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed

Does anyone know why Heroku can't find the package and if i can fix this ?

My packages are being installed by running the libraries indicated in my requirements.txt file:

asgiref==3.3.1
Django==3.1.5
django-cors-headers==3.6.0
django-user-visit==0.4.1
djangorestframework==3.12.2
gunicorn==20.0.4
psycopg2==2.8.6
pytz==2020.5
sqlparse==0.4.1
ua-parser==0.10.0
user-agents==2.2.0
whitenoise==5.2.0

What i've tried so far is to change the version to 0.4 and to not specify a version at all

3
  • 2
    What version of Python are you using? Do you have a runtime.txt? Commented Jan 22, 2021 at 2:33
  • 2
    pypi.org/project/django-user-visit requires Python >= 3.7. You need to use Python 3.7+ at Heroku. Commented Jan 22, 2021 at 7:54
  • 1
    Thank you Chris and phd, i guess that is my problem, Heroku is running 3.6.12 while my localhost 3.9, i will specify version 3.7 in my runtime.txt file Commented Jan 22, 2021 at 15:50

1 Answer 1

2

From the documentation: https://devcenter.heroku.com/articles/python-runtimes

If you’re running a Python application that requires a different supported runtime, or if you simply want to lock your project against patch updates until you’re ready to upgrade, you can specify which runtime to use for your app.

To specify a Python runtime, add a runtime.txt file to your app’s root directory that declares the exact version number to use.

after that

pip freeze > requirements.txt
Sign up to request clarification or add additional context in comments.

Comments

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.