如果我在崇高的文本或PyCharm中运行flask,则会收到此错误消息sublime issue(My OS: Ubuntu 16.04
)"socket.error: [Errno 98] Address already in use"
。但是,如果我在Ubuntu的terminal上运行flask,它就在运行。我了解该端口使用了另一项服务。然后,我试图从google/stackoverflow解决此问题。
# ps ax | grep 5000 // or # ps ax | grep name_of_service
# kill 3750 // or # killall name_of_service
但是什么都没有改变。当我尝试在Sublime或pycharm IDE上运行时,只有我发现了此问题。
最佳答案
简单的方法是使用定影器。
fuser <yourport>/tcp #this will fetch the process/service
将
<yourport>
替换为您要使用的端口#to kill the process using <yourport> add `-k` argument
fuser <yourport>/tcp -k
在你的情况下
fuser 5000/tcp -k
现在,您可以使用该端口运行flask。
关于python - Flask运行问题: socket.错误:[Errno 98]地址已在使用中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41393384/