Heroku web server will not start locally

I am having problems starting the heroku localy web server. Here is the error message that I keep getting:

PS C:\Users\Dragan\heroku_workspace\python-getting-started> heroku local [OKAY] Loaded ENV .env File as KEY=VALUE Format 10:01:32 web.1 | Traceback (most recent call last): 10:01:32 web.1 | File "c:\users\dragan\anaconda3\lib\runpy.py", line 170, in _run_module_as_main 10:01:32 web.1 | "__main__", mod_spec) 10:01:32 web.1 | File "c:\users\usr1\anaconda3\lib\runpy.py", line 85, in _run_code 10:01:32 web.1 | exec(code, run_globals) 10:01:32 web.1 | File C:\Users\Dragan\Anaconda3\Scripts\gunicorn.exe\__main__.py", line 5, in <module> 10:01:32 web.1 | File "c:\users\dragan\anaconda3\lib\site-packages\gunicorn\app\wsgiapp.py", line 10, in <module> 10:01:32 web.1 | from gunicorn.app.base import Application 10:01:32 web.1 | File "c:\users\dragan\anaconda3\lib\site-packages\gunicorn\app\base.py", line 12, in <module> 10:01:32 web.1 | from gunicorn import util 10:01:32 web.1 | File "c:\users\dragan\anaconda3\lib\site-packages\gunicorn\util.py", line 9, in <module> 10:01:32 web.1 | import fcntl 10:01:32 web.1 | ImportError: No module named 'fcntl' [DONE] Killing all processes with signal null 10:01:33 web.1 Exited with exit code 1 

I follow each step described in this LINK lesson. I installed a virtual environment inside the python-get-started project. I am trying to start a local web server from the project root directory.

Can someone help me solve this problem?

UPDATE_1: I installed Heroku Toolbelt for Windows, and I installed Anaconda for Python.

+5
source share
2 answers

According to Heroku's tutorial, try this on Windows instead of heroku local :

 heroku local web -f Procfile.windows 

https://devcenter.heroku.com/articles/getting-started-with-python#run-the-app-locally

+7
source

You are trying to deploy a Python web application to Heroku using the gunicorn web server. This works fine on Heroku, but CANNOT WORK on Windows, because gunicorn only works on nix based operating systems.

Instead of launching heroku local , you can run your web server WITHOUT sentinel weapons locally. Just say something like $ python myapp.py or whatever your main python web server file is. This will start your server locally using ONLY Python, not gunicorn.

+1
source

All Articles