Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
114 views
in Technique[技术] by (71.8m points)

python - Conda + Flask: server does not stop

I am learning Flask and i use anaconda to set up the envirnonment.

Anyway i managed to run the server and i stopped it from the terminal Control+C.

When i try to start the server again i get a message that

OSError: [Errno 98] Address already in use

Keep in mind, i am using Ubuntu. I had a similar error when i was running node. After i killed the server, the service would still listen to that port, so what i did was :

pkill -9 node

to make sure that the service had stopped.

So i figured i would do the same in my situation.

I typed ps aux | grep python and i got these processes:

root        1162  0.0  0.1  39400 20188 ?        Ss   10:01   0:00 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
root        1260  0.0  0.1 118116 23020 ?        Ssl  10:01   0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
user1      29712  0.0  0.1  35412 25840 pts/0    T    16:54   0:00 python app.py
user1      29713  0.0  0.1 182880 26740 pts/0    Tl   16:54   0:01 /home/user1/anaconda3/envs/flaskTest/bin/python /home/user1/Desktop/FlaskExperiments/app.py
user1      36470  0.0  0.0   9048  2552 pts/0    S+   22:32   0:00 grep --color=auto py

thon

The first two that is user root, reference the /usr/bin/python3.8 binary, which is the satnadra python insallation. Since i am using anaconda, its probably not that one.

Since i am using anaconda, what exactly do i have to do, in order to kill the flask server?

question from:https://stackoverflow.com/questions/65945957/conda-flask-server-does-not-stop

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...