简体   繁体   中英

Django application error when deploying to heroku

I want to deploy my Python / Django application on Heroku but I'm caught up with this weird error. One of the errors I couldn't fix was

wrapt==1.12.1) is not available for this stack (heroku-18)

I have searched everywhere on the internet and pip installing wrapt==1.12.1 but still, I kept getting the same error. What is the problem, and how can I fix it?

The full error message is below.

You are only quoting part of the error message. Here's a more complete quote:

Requested runtime (appdirs==1.4.4
asgiref==3.2.7
...
wrapt==1.12.1) is not available for this stack (heroku-18

This indicates a problem with your runtime.txt file . That file isn't for defining your dependencies; it's for telling Heroku what version of Python you want to use. It should only contain something like

python-3.8.5

Dependencies go into a file called requirements.txt (or, if you're using Pipenv, Pipfile and Pipfile.lock , but that doesn't seem to apply here).

I suspect simply renaming your runtime.txt to requirements.txt , committing the change, and redeploying will work. If you want to specify a particular Python version, you should also create a new runtime.txt in the correct format.

After installing wrapt==1.12.1 follow this steps:

Write below command in your reminal:

  pip freeze > requirements.txt
    
    git add .
    git commit -m "edit"
    git push heroku master

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM