I want to deploy my app on Heroku but it gives this error. I do not know if it is helpful but my python version is 3.9.2
here was an issue deploying your app. View the build log for details.
-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/python
-----> Python app detected
-----> No Python version was specified. Using the buildpack default: python-3.10.5
To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
-----> Installing python-3.10.5
-----> Installing pip 22.1.2, setuptools 60.10.0 and wheel 0.37.1
-----> Installing SQLite3
-----> Installing requirements with pip
Collecting anvil-uplink==0.3.40
Downloading anvil_uplink-0.3.40-py2.py3-none-any.whl (62 kB)
Collecting sklearn==0.0
Downloading sklearn-0.0.tar.gz (1.1 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting pandas==1.3.3
Downloading pandas-1.3.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.5 MB)
Collecting numpy==1.21.2
Downloading numpy-1.21.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.9 MB)
Collecting Flask==2.0.2
Downloading Flask-2.0.2-py3-none-any.whl (95 kB)
Collecting gunicorn==20.1.0
Downloading gunicorn-20.1.0-py3-none-any.whl (79 kB)
ERROR: Could not find a version that satisfies the requirement catboost==0.23 (from versions: 0.1.1.2, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6)
ERROR: No matching distribution found for catboost==0.23
! Push rejected, failed to compile Python app.
! Push failed
CodePudding user response:
I'm not familiar with CatBoost, but the downloads listed on PyPI for version 0.23 (April, 2020) appear to be built for CPython 2.7, 3.5, 3.6, 3.7, and 3.8.
Your application is using Python 3.10:
No Python version was specified. Using the buildpack default: python-3.10.5
You have two options:
Continue to use Python 3.10 and upgrade to a compatible version of CatBoost.
Version 1.0.1 (November, 2021) appears to be the oldest compatible version, and the latest version at the time of writing is version 1.0.6 (May, 2022).
I strongly urge you to update your local Python environment to match.
Use an older version of Python on Heroku.
Python 3.7 and 3.8 are still supported at the time of writing, but only on the Heroku-18 and Heroku-20 stacks. If you are using Heroku-22 you'll have to downgrade your stack.
You can tell Heroku which version of Python you wish to use by including a file called
runtime.txt
that contains the Python version in a particular format in the root directory of your project, e.g.python-3.8.13
Select a supported version, create your
runtime.txt
accordingly, commit it, then redeploy.