You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法通过Anaconda启动Jupyter Lab,遇端口占用及404错误

Fixing Jupyter Lab Port Conflict & 404 Error

First, let's recap the error you're encountering:

[I 01:37:29.009 LabApp] The port 8888 is already in use, trying another port.
[I 01:37:29.010 LabApp] The port 8889 is already in use, trying another port.
[I 01:37:29.010 LabApp] The port 8890 is already in use, trying another port.
[I 01:37:29.011 LabApp] The port 8891 is already in use, trying another port.
[I 01:37:29.011 LabApp] The port 8892 is already in use, trying another port.
[I 01:37:29.031 LabApp] JupyterLab beta preview extensio...

This issue almost always stems from leftover Jupyter Lab/Notebook processes running in the background (even if you closed the browser window) that are hogging those default ports. Here are straightforward fixes to resolve this:

1. Kill Stuck Jupyter Processes

On Windows:

  • Open Command Prompt or PowerShell.
  • Run this to find all Jupyter-related processes:
    tasklist | findstr "jupyter"
    
  • You’ll get a list of processes with their PID numbers. Kill each one with:
    taskkill /F /PID <your_pid_number>
    
    Replace <your_pid_number> with the actual number from the list.

On macOS or Linux:

  • Open Terminal.
  • Run this to locate processes using Jupyter’s default ports:
    lsof -i :8888
    
    (Swap 8888 with any port mentioned in your error if needed.)
  • Kill the process with:
    kill -9 <pid_number>
    
    Use the PID from the output here.

For a quicker cleanup, kill all Jupyter processes at once:

pkill -f jupyter

2. Launch Jupyter Lab on a Custom Port

If killing processes feels like a hassle, skip the default ports entirely by specifying an unused one when starting Jupyter. Open your Anaconda Prompt (or Terminal) and run:

jupyter lab --port 9000

Replace 9000 with any unused port number (like 9001, 9002—pick something outside the 8888-8892 range). This bypasses the conflict immediately.

3. Check for Non-Jupyter Apps Using the Ports

Sometimes other tools (web servers, databases, or even background services) might be using those ports. Verify this with:

  • Windows: netstat -ano | findstr ":8888"
  • macOS/Linux: netstat -tulpn | grep :8888
    If the process isn’t Jupyter, close that app or adjust its port settings to free up the space.

After trying one of these methods, restart Jupyter Lab via Anaconda—it should launch without the port conflict or 404 error.

内容的提问来源于stack exchange,提问作者Nuno Miguel Esguelha

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 03:50:35