Repository navigation
Import third-party packages causes the kernel to crash #25653
Copy link
Copy link
Closed as not planned
Labels
confirmation pendingThe issue needs to be confirmed through a maintainer reproducing the bug.The issue needs to be confirmed through a maintainer reproducing the bug.info-neededIssue requires more information from posterIssue requires more information from postertriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Description
Environment data
- VS Code version: 1.106.3
- Jupyter Extension version (available under the Extensions sidebar): 2025.9.1
- Python Extension version (available under the Extensions sidebar): 2025.18.0
- OS (Windows | Mac | Linux distro) and version: Windows
- Python and/or Anaconda version: python 3.13.9
- Type of virtual environment used: pixi
- Jupyter server running: Local
Expected behaviour
When importing a third-party packages, everything should work properly.
Actual behaviour
When importing the built-in package, the kernel works properly. Once I import a third-party package, the kernel crashes.
Steps to reproduce:
I have a pixi global environment base, and the following is my global environment.
Global environments as specified in 'C:\Users\cheny\.pixi\manifests\pixi-global.toml'
└── base
├─ dependencies: python 3.13.9, matplotlib 3.10.8, altair-all 6.0.0, jupyterlab 4.5.0, plotly 6.5.0, pandas 2.3.3, polars 1.35.2, marimo 0.18.0, openpyxl 3.1.5, streamlit 1.8.0, jupyter 1.1.1, python-kaleido 1.2.0, pip 25.3
└─ exposes: idle, pydoc, python, pythonw, jupyter-lab, jupyter-labextension, jupyter-labhub, jlpm, marimo, streamlit, jupyter, pip, pip3, ipythonIf I start the jupyter lab from terminal and edit it in browser, I can import the installed third-party packages. However, in vscode, when importing a third-party package, the kernel will crash.
Logs
14:24:50.432 [info] Restart requested ~\codes\py\python_notes\pandas\notes.ipynb
14:24:50.434 [warn] Cancel all remaining cells due to dead kernel
14:24:50.494 [error] Failed to get activated conda env vars for ~\.pixi\envs\base\python.exe
in 37ms
14:24:50.496 [error] Unable to determine site packages path for python ~\.pixi\envs\base\python.exe (Conda)
14:24:50.499 [info] Process Execution: ~\.pixi\envs\base\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
14:24:50.504 [info] Process Execution: ~\.pixi\envs\base\python.exe -Xfrozen_modules=off -m ipykernel_launcher --f=~\AppData\Roaming\jupyter\runtime\kernel-v334a645a02345535c3ce0b397a6d0be3c3dd27041.json
> cwd: ~\codes\py\python_notes\pandas
14:24:51.383 [info] Restarted 2af35a85-863a-4dfe-99c6-1cba345e1460
14:28:10.730 [error] Disposing session as kernel process died ExitCode: 3228369023, Reason:
14:28:38.735 [error] Error in notebook cell execution Error: 内核 "base(Pixi) (Python 3.13.9)" 已终止。有关详细信息,请单击[此处](https://aka.ms/vscodeJupyterKernelCrash)。有关更多详细信息,请查看 Jupyter [log](command:jupyter.viewOutput)。
> Kernel Id = .undefined.-xfrozen_modules=off.~\.pixi\bin\python.exe.~\.pixi\envs\base\python.exe.-xfrozen_modules=off#-m#ipykernel_launcher
> Interpreter Id = ~\.pixi\envs\base\python.exe
> at n.verifyKernelState (~\.vscode\extensions\ms-toolsai.jupyter-2025.9.1-win32-x64\dist\extension.node.js:309:81661)
> originalException = undefined
14:28:38.736 [error] Error in execution (get message for cell) Error: 内核 "base(Pixi) (Python 3.13.9)" 已终止。有关详细信息,请单击[此处](https://aka.ms/vscodeJupyterKernelCrash)。有关更多详细信息,请查看 Jupyter [log](command:jupyter.viewOutput)。
> Kernel Id = .undefined.-xfrozen_modules=off.~\.pixi\bin\python.exe.~\.pixi\envs\base\python.exe.-xfrozen_modules=off#-m#ipykernel_launcher
> Interpreter Id = ~\.pixi\envs\base\python.exe
> at n.verifyKernelState (~\.vscode\extensions\ms-toolsai.jupyter-2025.9.1-win32-x64\dist\extension.node.js:309:81661)
> originalException = undefinedReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
confirmation pendingThe issue needs to be confirmed through a maintainer reproducing the bug.The issue needs to be confirmed through a maintainer reproducing the bug.info-neededIssue requires more information from posterIssue requires more information from postertriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Activity
DonJayamanne commentedon Dec 1, 2025
Thank you for share the logs, please can you you enable logging as follows (and please share all of the logs):
Jupyter->LoggingtraceJupyteroutput panel (use the commandJupyter: Show Outputto get to the logs).I need all of the logs to get more context on Python env, versions, what happens and when, etc
If you want to remove any sensitve information (like paths) please feel free to do so, but let me know what was removed and what it was replaced with.
chenyulue commentedon Dec 2, 2025
The full log are as follows Don Jayamanne (@DonJayamanne)
DonJayamanne commentedon Dec 10, 2025
chenyulue
Are you able to create a virtual environment, i.e. try using something other than Pixi to test this.
I suspect this issue is specific to Pixi environment support in Jupyter/Python extension.
chenyulue commentedon Dec 11, 2025
Don Jayamanne (@DonJayamanne) When I use
uvto create a virtual environment, and choose the kernel therein, the third-party packages such aspandascan be imported successfully.I also test a virtual environment created by
pixi init test, and there I can import the third-party package too.So maybe the issue is related to the global environment created by pixi.
DonJayamanne commentedon Dec 12, 2025
Eleanor Boyd (@eleanorjboyd) Karthik Nadig (@karthiknadig)
Transferring issue here as Python extension API fails to resolve env vars for the environment. & as a result things fall over in Jupyter extension
I believe its because its a variant of conda, which needs proper activation unlike venv
eleanorjboyd commentedon Dec 18, 2025
Follow up question here- you are using Conda as the environment manager right? Have you tried the pixi specific environment manager made by a community member here: https://github.com/renan-r-santos/pixi-code
chenyulue commentedon Dec 19, 2025
Eleanor Boyd (@eleanorjboyd) I've tried the pixi-code plugin, and the same issue happens. The problem is related to the pixi global environment, that is, I use such as
pixi global install pandas --environment baseto create a global environment and install the related packages. After that, if I import a globally installed third-party package, the kernel will crash.However, everything works correctly if I use jupyter by
jupyter labin browser.eleanorjboyd commentedon Jan 8, 2026
Have you tried the pixi extension from one of our community members? https://marketplace.visualstudio.com/items?itemName=renan-r-santos.pixi-code is made specifically to work with the Python Envs extension and Pixi environments
github-actions commentedon Feb 8, 2026
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.
Happy Coding!
Elektrobomb commentedon Mar 11, 2026
Hey! I am seeing the same issue:
renan-r-santos, all of the above behaviour is using that plugin.Logs when launching VSCode from start menu
Logs when launching VSCode with pixi from terminal