Help Center/ ModelArts/ FAQs/ Notebook/ What Do I Do If There Is a Noticeable Delay on the First Code Cell Execution After Opening an .ipynb File in Code Server?
Updated on 2026-07-02 GMT+08:00

What Do I Do If There Is a Noticeable Delay on the First Code Cell Execution After Opening an .ipynb File in Code Server?

Symptom

There is a noticeable delay (over 30 seconds) when the code cell is executed for the first time after an .ipynb file is opened in Code Server.

Figure 1 Opening an .ipynb file

Possible Causes

There is no ipykernel dependency package in the current image environment. The first time you run a notebook file, Code Server automatically starts the backend installation. Since dependencies must be downloaded and compiled from the official source, this initialization process can take quite a while.

Solution

You are advised to manually install ipykernel.

  1. In the navigation pane of Code Server, click and choose Terminal > New Terminal.
  2. Install ipykernel.
    # (Optional) Check the current Conda environment.
    conda env list
    
    # Activate the base environment. (If you are using a different environment, replace base with the name of that environment.)
    conda activate base
    
    # Install ipykernel. (You are advised to use a mirror source in China to speed up the download.)
    pip install ipykernel
    Figure 2 Installing ipykernel
  3. Run the following command to check whether ipykernel is installed successfully:
    pip show ipykernel

    If the ipykernel version information is displayed, ipykernel is successfully installed.

    Figure 3 Viewing ipykernel details