jupyter端口被占用解决方法

断网之后xshell就掉了,但是jupyter还在运行,重新打开就是下一个端口,不想增加隧道,所以选择直接杀死端口

查看当前终端在运行的端口

jupyter notebook list

显示有三个端口在开着:

Currently running servers:
http://localhost:7548/ :: /root
http://localhost:7549/ :: /root
http://localhost:7550/ :: /root

查看端口的PID

(一)方法一:

ps -aux | grep jupyter
(base) root@c21****5:~# ps -aux | grep jupyter
root     10312  0.0  0.0  83060 57180 pts/0    T    08:54   0:00 /root/anaconda3/bin/python /root/anaconda3/bin/jupyter-notebook
root     10316  0.0  0.0  83056 57276 pts/0    T    08:54   0:00 /root/anaconda3/bin/python /root/anaconda3/bin/jupyter-notebook
root     10342  0.0  0.0  14428  1100 pts/0    S+   09:13   0:00 grep --color=auto jupyter

第二列就是对应的PID
(二)方法二:

lsof -i :端口号

(三)方法三:

netstat -aon | findstr “端口号”

杀死程序

kill -9 PID

最后查看是否还有端口在占用

(base) root@c21032303135:~# jupyter notebook list
Currently running servers:

完成!!!

  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值