Heroku/python failed to detect set buildpack

后端 未结 3 685
隐瞒了意图╮
隐瞒了意图╮ 2021-01-01 21:10

I\'m a Django newbie, I created an app and want to deploy it using Heroku. However, when I do git push heroku master (I follow Heroku\'s getting started), this

3条回答
  •  悲&欢浪女
    2021-01-01 21:46

    Here are steps by steps you can solve the above problem:

    1. Create a requirements.txt file in your app folder.

    2. Run command pip freeze > requirements.txt from the same folder.

    3. Now commit your changes.

      git add .

      git commit -m "requirements added"

      git push heroku master

    Here's the catch, In my case: I did it without adding any modules because pip can also install a dependency from your local codebase automatically. After running the command when i checked my requirement.txt file there were already modules added automatically.

    NOTE: If this didn't happens to you, you can do it manually like Harrison said in his answer.

    1. This step is only if you get an error similar to my case i got an error about conda== version cant be found. As the modules have been added automatically based on my local codebase, Conda version is installed in my local machine thats why it was automatically added in my requirement.txt file. All you have to do is to remove it from the requirements.txt file.

    2. Commit your changes again.

    Thought it might help some of you who faced similar errors.

提交回复
热议问题