Couldn't find that process type, Heroku

我的未来我决定 提交于 2020-01-02 04:29:08

问题


I'm trying to deploy a simple python bot on Heroku but I get the error
couldn't find that process type

When I try to scale the dynos. I already made a procfile and it looks like this:
web: gunicorn dep:app, where "dep" is the name of my python code

What could be the reason?


回答1:


This may happen if your procfile is misspelt, such as "procfile" or "ProcFile" etc. The file name should be "Procfile" (with a capital P).

sometimes changing the file name is not anough, because git wouldn't spot the change. I had to delete the Procfile completely, then commit the change, than add it again with the right name, and then commit that again:

  1. remove your procfile
  2. git commit
  3. add a new procfile with the exact name "Procfile"
  4. commit again
  5. git push heroku master

should work!




回答2:


Make Sure Procfile should not have any extension like .txt otherwise this will be the error

remote: -----> Discovering process types remote: Procfile declares types -> (none)

To create file without extension type following in cmd notepad Procfile. Now add web: gunicorn dep:app and save Now when you will git push heroku master the above lines will be like

remote: -----> Discovering process types remote: Procfile declares types -> web

And the error is gone when you will run

C:\Users\Super-Singh\PycharmProjects\URLShortener>heroku ps:scale web=1

Scaling dynos... done, now running web at 1:Free




回答3:


You might check your python version. I tried to deploy my Django project so my procfile looks like this web: gunicorn blog.wsgi --log-file - and I also got the same error couldn't find that process type. and I found that Heroku only support python-3.6.4 and python-2.7.14 while I just had python3.5. You can type:

python -V

to see what python version you are using now. if not, you can download python 3.6. I followed this How do I install Python 3.6 using apt-get?

Ubuntu 14.04 and 16.04

If you are using Ubuntu 14.04 or 16.04, you can use Felix Krull's deadsnakes PPA at https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa:

sudo add-apt-repository ppa:deadsnakes/ppa

sudo apt-get update

sudo apt-get install python3.6

Alternatively, you can use J Fernyhough's PPA at https://launchpad.net/~jonathonf/+archive/ubuntu/python-3.6:

sudo add-apt-repository ppa:jonathonf/python-3.6

sudo apt-get update

sudo apt-get install python3.6

and remember to keep you python 3.5. Don't remove it. and specify your python version in the runtime.txt file: python-3.6.4 and run:

heroku ps:scale web=1 --app [my app's name]

and the problem solved. I hope my answer might help you.




回答4:


this problem mainly cause when you try to create the Procfile by using command prompt or through terminal. I recommend create the Procfile manually.

If you are using Visual Studio code then, click on pipfile and then on upper side click create new file button and enter the name of the file as Procfile. Before doing this delete previous Procfile and also use the command git rm procfile -f in command prompt in your active virtual environment.

if you are using any other IDE then open notepad and enter this line in it web: gunicorn mb_project.wsgi --log-file - after that save it as Procfile and put this file below your pipfile.

here is the link of my files https://github.com/YashMarmat/message-board-app.git



来源:https://stackoverflow.com/questions/48512013/couldnt-find-that-process-type-heroku

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!