Help us understand the problem. What is going on with this article?

【Python@Flask】エラー "OSError: [Errno 48] Address already in use" の回避策について

More than 3 years have passed since last update.

Flask で application.run('127.0.0.1', 5000, debug=True) を実行したが、何もせずそのまま終了しました。次回、再度実行する時に、以下のエラーメッセージが表示されます。

"OSError: [Errno 48] Address already in use"

調べたところ、前回実行したプロセスはまだ残っているようです。
現時点の回避策としては、当該のプロセスIDを検索し、削除する方法があります。

  1. 以下のいずれかのコマンドでプロセスIDを検索
    1. ps -fA | grep python
    2. lsof -i :5000 | grep python
  2. kill processID

ps: 現在動作しているプロセスを表示する
lsof: オープンしているファイルの情報を表示する(実行には root 権限が必要)


参考

socket.error: [Errno 48] Address already in use
Need to close python socket / Find the current running server on my dev environment

ringCurrent
I think therefore I am.
itpm-gk
頑張るエンジニアを応援する会社です。まだまだ発展途上です!
https://www.itpm-gk.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした