编译报错:
Address already in use Port 5000 is in use by another program. Either identify and stop that program, or start the server with a different port. On macOS, try disabling the 'AirPlay Receiver' service from System Preferences -> Sharing.
一、查看端口占用情况(查看占用程序、PID等等)
//在终端中输入
sudo losf -I tcp:端口
//如上述错误中5000端口的占用情况
sudo losf -I tcp:5000
如图所示
二、端口释放(使用kill命令)
//终端输入
kill -9 pid(端口号)
//上述图示中的python占用的5000端口的pid号为2659
kill -9 2659