python flask启动时报错,端口被占用,OSError: [Errno 98] Address already in use
python flask启动时报错,端口被占用,OSError: [Errno 98] Address already in use
方法1:用如下命令,查一下python 的进程

ps -fA | grep python

如下图
python flask启动时报错,端口被占用,OSError: [Errno 98] Address already in use

然后我发现是30156或者30178进程占用的端口,解决方法:结束可能占用的进程。

sudo kill -9 你的进程ID

python flask启动时报错,端口被占用,OSError: [Errno 98] Address already in use
方法2:查看端口占用的进程,比如你的端口设置的是5000,用如下命令

lsof -i:5000

再根据端口占用的pid,将这个pid kill 掉就行。
kill 完了,再启动应该就没问题了。

相关文章:

  • 2021-06-14
  • 2021-05-23
  • 2021-04-26
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2021-06-21
  • 2022-12-23
猜你喜欢
  • 2022-01-10
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
相关资源
相似解决方案