Tags
python
Asked 4 years ago
2 Apr 2020
Views 8087
sarah

sarah posted

on flask app run , getting : OSError: [Errno 98] Address already in use

i am running flask app by command

python app.py

and geting following error
 
 * Debug mode: on
Traceback (most recent call last):
  File "app.py", line 5, in <module>
    app.run()
  File "python3.5/site-packages/flask/app.py", line 990, in run
    run_simple(host, port, self, **options)
  File "/python3.5/site-packages/werkzeug/serving.py", line 1030, in run_simple
    s.bind(server_address)
OSError: [Errno 98] Address already in use

Nilesh

Nilesh
answered Nov 30 '-1 00:00

OSError: [Errno 98] Address already in use
Means ip address 0.0.0.0 already using by some other python or any other app

so first free the app and than try to run

to get the list of all program with using ip address , run this command

 ps -fA | grep python

you will get output like this



root 1379 1 0 2019 ? 00:00:00 python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
odoo 1490 1 0 2019 ? 00:21:31 python3 /odoo/odoo-server/odoo-bin -c /etc/odoo-server.conf
ubuntu 16198 15698 0 07:56 pts/4 00:00:00 grep --color=auto python
ubuntu 12945 12613 0 07:15 pts/0 00:00:00 python app.py


now kill the process by command "kill"
like

kill 12945
Post Answer