Skip to content

Importing third party packages crashes kernel of Jupyter notebooks in VScode #25700

Closed as not planned

Description

Environment data

  • VS Code version: 1.107.0
  • Jupyter Extension version (available under the Extensions sidebar): 2025.9.1
  • Python Extension version (available under the Extensions sidebar): 2025.20.0
  • OS (Windows | Mac | Linux distro) and version: Windows 11 Enterprise (Version 23H2)
  • Python and/or Anaconda version: Miniforge_BASE_24.11.3; conda 24.11.3; mamba 1.5.12
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): mamba
  • Jupyter server running: Local

Expected behaviour

Until this morning, I could use my Python environments and create new ones with e.g. mamba create -n <name> -c conda-forge python=3.12 numpy jupyter ... which would work in VScode and I could import any installed package.

Actual behaviour

Now, whenever I try to import a third party package, the kernel dies (even for freshly installed environments) and the logs show the following errors:

[error] Failed to get activated conda env vars for c:\Trusted\test_env2\python.exe
[error] Unable to determine site packages path for python c:\Trusted\test_env2\python.exe (Conda)

The kernel nevertheless starts successfully and can import packages like os and generally execute cells. Only third party packages cause the kernel crash. When instead activating an environment in the command line and starting jupyter from there, everything works normally. Also, my old environments still work as intended, as well, even in VScode.

Noteworthy, the Python environments are stored in this Trusted folder while mamba is installed under C:\Program Files\miniforge3\Scripts\mamba.exe as per company policy. However, until now this setup worked.

Steps to reproduce:

If the installation paths are the culprit, I am not sure how this would be easily reproducible elsewhere.

Logs

Image

Activity

  1. loewenm commented on Dec 17, 2025

    @loewenm

    Exact same issue with a fresh Windows 11 and VS Code install, etc.

    The output is identical indicating the same ExitCode 3228369023 and no "Reason" provided.

    11:58:16.131 [info] Restarted d5c4b729-17e8-4919-8ac0-68d4f6ce362c
    11:58:28.033 [info] Generated code for 11 = <ipython-input-11-2bcfa45c40a8> with 8 lines
    11:58:36.223 [info] Generated code for 12 = <ipython-input-12-a0d2faabd9e9> with 1 lines
    11:58:40.101 [error] Disposing session as kernel process died ExitCode: 3228369023, Reason: 
    

    Importantly:

    • Importing standard Python packages (e.g. os, sys, time, etc.) causes no issue as seen at time stamp 11:58:28:033.
    • Importing any third-party package (e.g. Numpy, Pandas, Matplotlib, etc.) results in the kernel crash a few seconds later (i.e., time stamp 11:58:36:223).
    • This is not an issue when running python scripts directly in a terminal/command prompt (i.e., in the same venv/conda env) — it only occurs when attempting to run on VS Code.
    • My remote Linux Ubuntu 22 workstation, which has not been updated in some time, does not have this issue.
  2. DonJayamanne commented on Dec 18, 2025

    @DonJayamanne

    loewenm (@loewenm) are you also using a Conda/Pixi environment?

  3. loewenm commented on Dec 19, 2025

    @loewenm

    I am using a recently installed Conda environment on Windows 11. Here's my full build.

    name: <project_name>
    channels:
      - conda-forge
      - defaults
    dependencies:
      - _openmp_mutex=4.5=2_gnu
      - asttokens=3.0.0=py312haa95532_0
      - brotli=1.2.0=h2d644bc_1
      - brotli-bin=1.2.0=hfd05255_1
      - bzip2=1.0.8=h0ad9c76_8
      - ca-certificates=2025.12.2=haa95532_0
      - cairo=1.18.4=h5782bbf_0
      - colorama=0.4.6=py312haa95532_0
      - contourpy=1.3.3=py312hf90b1b7_3
      - cuda-version=12.9=h4f385c5_3
      - cycler=0.12.1=pyhcf101f3_2
      - decorator=5.2.1=py312haa95532_0
      - double-conversion=3.4.0=hac47afa_0
      - executing=2.2.1=py312haa95532_0
      - font-ttf-dejavu-sans-mono=2.37=hab24e00_0
      - font-ttf-inconsolata=3.000=h77eed37_0
      - font-ttf-source-code-pro=2.038=h77eed37_0
      - font-ttf-ubuntu=0.83=h77eed37_3
      - fontconfig=2.15.0=h765892d_1
      - fonts-conda-ecosystem=1=0
      - fonts-conda-forge=1=hc364b38_1
      - fonttools=4.61.1=py312h05f76fc_0
      - freetype=2.14.1=h57928b3_0
      - graphite2=1.3.14=hac47afa_2
      - greenlet=3.3.0=py312hbb81ca0_0
      - harfbuzz=12.2.0=h5f2951f_0
      - icu=75.1=he0c23c2_0
      - ipython=9.7.0=py312haa95532_0
      - ipython_pygments_lexers=1.1.1=py312haa95532_0
      - jedi=0.19.2=py312haa95532_0
      - joblib=1.5.3=pyhd8ed1ab_0
      - kiwisolver=1.4.9=py312h78d62e6_2
      - krb5=1.21.3=hdf4eb48_0
      - lcms2=2.17=hbcf6048_0
      - lerc=4.0.0=h6470a55_1
      - libblas=3.11.0=5_hf2e6a31_mkl
      - libbrotlicommon=1.2.0=hfd05255_1
      - libbrotlidec=1.2.0=hfd05255_1
      - libbrotlienc=1.2.0=hfd05255_1
      - libcblas=3.11.0=5_h2a3cdd5_mkl
      - libclang13=21.1.7=default_ha2db4b5_1
      - libdeflate=1.25=h51727cc_0
      - libexpat=2.7.3=hac47afa_0
      - libffi=3.5.2=h52bdfb6_0
      - libfreetype=2.14.1=h57928b3_0
      - libfreetype6=2.14.1=hdbac1cb_0
      - libgcc=15.2.0=h8ee18e1_16
      - libglib=2.86.3=h0c9aed9_0
      - libgomp=15.2.0=h8ee18e1_16
      - libhwloc=2.12.1=default_h4379cf1_1003
      - libiconv=1.18=hc1393d2_2
      - libintl=0.22.5=h5728263_3
      - libjpeg-turbo=3.1.2=hfd05255_0
      - liblapack=3.11.0=5_hf9ab0e9_mkl
      - liblzma=5.8.1=h2466b09_2
      - liblzma-devel=5.8.1=h2466b09_2
      - libpng=1.6.53=h7351971_0
      - libsqlite=3.51.1=hf5d6505_0
      - libtiff=4.7.1=h8f73337_1
      - libvulkan-loader=1.4.328.1=h477610d_0
      - libwebp-base=1.6.0=h4d5522a_0
      - libwinpthread=12.0.0.r4.gg4f2fc60ca=h57928b3_10
      - libxcb=1.17.0=h0e4246c_0
      - libxgboost=3.1.2=cuda129_h8216274_2
      - libxml2=2.15.1=ha29bfb0_0
      - libxml2-16=2.15.1=h06f855e_0
      - libxslt=1.1.43=h0fbe4c1_1
      - libzlib=1.3.1=h2466b09_2
      - llvm-openmp=21.1.7=h4fa8253_0
      - matplotlib=3.10.8=py312h2e8e312_0
      - matplotlib-base=3.10.8=py312h0ebf65c_0
      - matplotlib-inline=0.2.1=py312haa95532_0
      - mkl=2025.3.0=hac47afa_454
      - munkres=1.1.4=pyhd8ed1ab_1
      - numpy=2.3.5=py312ha72d056_0
      - openjpeg=2.5.4=h24db6dd_0
      - openssl=3.6.0=h725018a_0
      - packaging=25.0=pyh29332c3_1
      - pandas=2.3.3=py312hc128f0a_2
      - parso=0.8.5=py312haa95532_0
      - patsy=1.0.2=pyhcf101f3_0
      - pcre2=10.47=hd2b5f0e_0
      - pillow=12.0.0=py312h31f0997_2
      - pip=25.3=pyh8b19718_0
      - pixman=0.46.4=h5112557_1
      - prompt-toolkit=3.0.52=py312haa95532_1
      - prompt_toolkit=3.0.52=hd3eb1b0_1
      - pthread-stubs=0.4=h0e40799_1002
      - pure_eval=0.2.3=py312haa95532_0
      - py-xgboost=3.1.2=cuda129_pyh3031c10_2
      - pygments=2.19.2=py312haa95532_0
      - pyodbc=5.3.0=py312hbb81ca0_0
      - pyparsing=3.2.5=pyhcf101f3_0
      - pyside6=6.10.1=py312h0c8bdd4_0
      - python=3.12.4=h889d299_0_cpython
      - python-dateutil=2.9.0.post0=pyhe01879c_2
      - python-tzdata=2025.3=pyhd8ed1ab_0
      - python_abi=3.12=8_cp312
      - pytz=2025.2=pyhd8ed1ab_0
      - qhull=2020.2=hc790b64_5
      - qt6-main=6.10.1=hf1bda90_2
      - scikit-learn=1.8.0=np2py312hea30aaf_1
      - seaborn=0.13.2=hd8ed1ab_3
      - seaborn-base=0.13.2=pyhd8ed1ab_3
      - setuptools=80.9.0=pyhff2d567_0
      - six=1.17.0=pyhe01879c_1
      - sqlalchemy=2.0.45=py312he06e257_0
      - sqlite=3.51.1=hdb435a2_0
      - stack_data=0.6.3=py312haa95532_0
      - statsmodels=0.14.6=py312h196c9fc_0
      - tbb=2022.3.0=hd094cb3_1
      - threadpoolctl=3.6.0=pyhecae5ae_0
      - tk=8.6.13=h2c6b04d_3
      - tornado=6.5.4=py312he06e257_0
      - traitlets=5.14.3=py312haa95532_0
      - typing-extensions=4.15.0=h396c80c_0
      - typing_extensions=4.15.0=pyhcf101f3_0
      - tzdata=2025c=h8577fbf_0
      - ucrt=10.0.26100.0=h57928b3_0
      - unicodedata2=17.0.0=py312he06e257_1
      - vc=14.3=h2b53caa_33
      - vc14_runtime=14.44.35208=h818238b_33
      - vcomp14=14.44.35208=h818238b_33
      - wcwidth=0.2.13=py312haa95532_0
      - wheel=0.45.1=pyhd8ed1ab_1
      - xgboost=3.1.2=cuda129_pyh5c66634_2
      - xorg-libxau=1.0.12=hba3369d_1
      - xorg-libxdmcp=1.1.5=hba3369d_1
      - xz=5.8.1=h208afaa_2
      - xz-tools=5.8.1=h2466b09_2
      - zlib-ng=2.3.2=h5112557_0
      - zstd=1.5.7=h534d264_6
      - pip:
          - comm==0.2.3
          - debugpy==1.8.19
          - ipykernel==6.31.0
          - jupyter-client==8.7.0
          - jupyter-core==5.9.1
          - nest-asyncio==1.6.0
          - platformdirs==4.5.1
          - psutil==7.1.3
          - pyzmq==27.1.0
          - scipy==1.16.3
    prefix: C:\Users\mloewen\AppData\Local\miniconda3\envs\<project_name>
    
  4. DonJayamanne commented on Dec 19, 2025

    @DonJayamanne

    loewenm (@loewenm)

    Please could you enable logging as follows:

    • Open settings & go into Jupyter->Logging
    • Change the value to trace
    • Reload VS Code,
    • Attempt to repro the issue & then copy the output from the Jupyter output panel (use the command Jupyter: Show Output to get to the logs).
  5. loewenm commented on Dec 23, 2025

    @loewenm

    Jupter logging output below

    Order of events:

    • opened project in local workspace
    • executed imports of standard Python packages (i.e. datetime, os, sys, time) -> No issues
    • executed from IPython.display import display, works without issue
    • execute any one of the following packages results in the kernel crash shown below (E.g., matplotlib.pyplot, numpy, pandas, sqlalchemy, etc.)
    Visual Studio Code (1.107.1, undefined, desktop)
    Jupyter Extension Version: 2025.9.1.
    Python Extension Version: 2025.20.1.
    Python Environment Extension Version: 1.14.0.
    Pylance Extension Version: 2025.10.4.
    Platform: win32 (x64).
    Home = c:\Users\mloewen
    Temp Storage folder ~\AppData\Roaming\Code\User\globalStorage\ms-toolsai.jupyter\version-2025.9.1
    Multiple Workspace folders opened g:\AI\<folder1>, g:\AI\<folder2>, g:\AI\<folder3>, g:\AI\<folder4>, g:\AI\<folder5>
    08:19:51.258 [debug] getDataDirsImpl, Class name = zr (started execution), Arg 1: undefined, Arg 2: undefined
    08:19:51.260 [debug] Start refreshing Kernel Picker (1766495991260)
    08:19:51.390 [trace] Search for KernelSpecs in Interpreter ~\AppData\Local\miniconda3\python.exe
    08:19:51.391 [trace] Search for KernelSpecs in Interpreter ~\AppData\Local\miniconda3\envs\<folder1>\python.exe
    08:19:51.519 [debug] Get Custom Env Variables, Class name = Gm, completed in 259ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
    08:19:51.519 [debug] Jupyter Paths : 
    08:19:51.526 [debug] getDataDirsImpl, Class name = zr, completed in 268ms, has a truthy return value, Arg 1: undefined, Arg 2: undefined, Return Value: <Uri:/C:/Users/<username>/AppData/Roaming/jupyter>, <Uri:/C:/ProgramData/jupyter>
    08:19:51.528 [debug] Kernel Spec Root Paths, ~\AppData\Roaming\jupyter\kernels, c:\ProgramData\jupyter\kernels, home\<username>\.local\share\jupyter\kernels
    08:19:51.533 [trace] Conda file is conda
    08:19:51.823 [trace] Hiding default KernelSpec python for interpreter ~\AppData\Local\miniconda3\envs\<folder1>\python.exe (KernelSpec file ~\AppData\Local\miniconda3\envs\<folder1>\share\jupyter\kernels\python3\kernel.json)
    08:19:51.825 [debug] End refreshing Kernel Picker (1766495991260)
    08:20:10.712 [debug] creating new code watcher with matching document file:///g%3A/AI/<folder1>/src/operations/upload_forecasts.py
    08:20:10.713 [debug] CodeLensFactory: Generating new code lenses for version 1 of document file:///g%3A/AI/<folder1>/src/operations/upload_forecasts.py for commands jupyter.runcell, jupyter.runallcellsabove, jupyter.debugcell, jupyter.debugcontinue, jupyter.debugstop, jupyter.debugstepover
    08:20:15.103 [debug] Start refreshing Kernel Picker (1766496015103)
    08:20:15.104 [info] Starting interactive window for resource 'g:\AI\<folder1>\src\operations\upload_forecasts.py' with controller '.jvsc74a57bd043e0cebfe0f1af3dcd2d964371a7e16383a9c82519c5ef986aad1568fd99d317.~\AppData\Local\miniconda3\envs\<folder1>\python.exe.~\AppData\Local\miniconda3\envs\<folder1>\python.exe.-m#ipykernel_launcher (Interactive)'
    08:20:15.104 [debug] End refreshing Kernel Picker (1766496015103)
    08:20:15.203 [debug] Start refreshing Interpreter Kernel Picker
    08:20:15.203 [debug] Start refreshing Kernel Picker (1766496015203)
    08:20:15.287 [debug] Controller selection change completed
    08:20:15.298 [debug] Get Custom Env Variables, Class name = Gm, completed in 1ms, has a truthy return value, Arg 1: "/G:/AI/<folder1>", Arg 2: "RunPythonCode"
    08:20:15.394 [error] Failed to get activated conda env vars for ~\AppData\Local\miniconda3\envs\<folder1>\python.exe
                     in 97ms
    08:20:15.396 [error] Unable to determine site packages path for python ~\AppData\Local\miniconda3\envs\<folder1>\python.exe (Conda)
    08:20:15.396 [trace] Prepend PATH with python bin for ~\AppData\Local\miniconda3\envs\<folder1>\python.exe
    08:20:15.396 [debug] Getting activated env variables, Class name = Wd, completed in 100ms, has a truthy return value, Arg 1: "/G:/AI/<folder1>", Arg 2: "~\\AppData\\Local\\miniconda3\\envs\\<folder1>\\python.exe", Arg 3: undefined
    08:20:15.409 [info] Process Execution: ~\AppData\Local\miniconda3\envs\<folder1>\python.exe -m pip list
    08:20:15.624 [debug] Refreshed Environments
    08:20:15.628 [trace] Python API env change detected, update => '~\AppData\Local\miniconda3\envs\<folder1>\python.exe'
    08:20:16.459 [debug] Interactive Window Editor Created: untitled:/Interactive-1.interactive with input box: vscode-interactive-input:/InteractiveInput-1
    08:20:16.463 [debug] start the kernel, options.disableUI=false for Interactive-1.interactive
    08:20:16.466 [info] Starting Kernel (Python Path: ~\AppData\Local\miniconda3\envs\<folder1>\python.exe, Conda, 3.12.4) for 'Interactive-1.interactive' (disableUI=false)
    08:20:16.467 [trace] Creating raw notebook for resource 'g:\AI\<folder1>\src\operations\upload_forecasts.py'
    08:20:16.539 [debug] Get Custom Env Variables, Class name = Gm, completed in 1ms, has a truthy return value, Arg 1: "/G:/AI/<folder1>/src/operations/upload_forecasts.py", Arg 2: "RunPythonCode"
    08:20:16.542 [debug] Launching kernel .jvsc74a57bd043e0cebfe0f1af3dcd2d964371a7e16383a9c82519c5ef986aad1568fd99d317.~\AppData\Local\miniconda3\envs\<folder1>\python.exe.~\AppData\Local\miniconda3\envs\<folder1>\python.exe.-m#ipykernel_launcher for g:\AI\<folder1>\src\operations\upload_forecasts.py in g:\AI\<folder1>\src\operations with ports 9002, 9001, 9005, 9003, 9004
    08:20:16.625 [debug] End refreshing Kernel Picker (1766496015203)
    08:20:16.629 [error] Failed to get activated conda env vars for ~\AppData\Local\miniconda3\envs\<folder1>\python.exe
                     in 91ms
    08:20:16.630 [error] Unable to determine site packages path for python ~\AppData\Local\miniconda3\envs\<folder1>\python.exe (Conda)
    08:20:16.630 [trace] Prepend PATH with python bin for ~\AppData\Local\miniconda3\envs\<folder1>\python.exe
    08:20:16.630 [debug] Getting activated env variables, Class name = Wd, completed in 92ms, has a truthy return value, Arg 1: "/G:/AI/<folder1>/src/operations/upload_forecasts.py", Arg 2: "~\\AppData\\Local\\miniconda3\\envs\\<folder1>\\python.exe", Arg 3: undefined
    08:20:16.653 [info] Process Execution: ~\AppData\Local\miniconda3\envs\<folder1>\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
    08:20:16.679 [info] Process Execution: ~\AppData\Local\miniconda3\envs\<folder1>\python.exe ~\.vscode\extensions\ms-toolsai.jupyter-2025.9.1-win32-x64\pythonFiles\vscode_datascience_helpers\kernel_interrupt_daemon.py --ppid 40756
        > cwd: ~\.vscode\extensions\ms-toolsai.jupyter-2025.9.1-win32-x64\pythonFiles\vscode_datascience_helpers
    08:20:16.862 [trace] Got a response of 3320 for INITIALIZE_INTERRUPT:0
    08:20:16.888 [info] Process Execution: ~\AppData\Local\miniconda3\envs\<folder1>\python.exe -m ipykernel_launcher --f=~\AppData\Roaming\jupyter\runtime\kernel-v3663f9d303bcffe56f2865abc280d1c1cf069276d.json
        > cwd: g:\AI\<folder1>\src\operations
    08:20:16.888 [debug] Kernel process 5904.
    08:20:17.440 [trace] ipykernel version & path 6.31.0, ~\AppData\Local\miniconda3\envs\<folder1>\Lib\site-packages\ipykernel\__init__.py for ~\AppData\Local\miniconda3\envs\<folder1>\python.exe
    08:20:19.078 [debug] Kernel output 5904: To connect another client to this kernel, use:
    --existing ~\AppData\Roaming\jupyter\runtime\kernel-v3663f9d303bcffe56f2865abc280d1c1cf069276d.json
    08:20:19.194 [debug] Waiting for Raw Session to be ready in postStartRawSession
    08:20:19.194 [debug] Waiting for Raw session to be ready, status: connected
    08:20:19.194 [trace] Raw session connected
    08:20:19.195 [debug] Waited for Raw session to be ready & got status: connected
    08:20:19.195 [debug] Successfully waited for Raw Session to be ready in postStartRawSession
    08:20:19.195 [debug] Kernel status is 'unknown' before requesting kernel info and after ready
    08:20:19.195 [debug] Sending request for kernelInfo
    08:20:19.400 [trace] Got response for requestKernelInfo
    08:20:19.400 [debug] Successfully completed postStartRawSession after 1 attempt(s) in 205ms
    08:20:19.403 [trace] Executing silently Code (busy) = import sys as _VSCODE_sys\nprint(_VSCODE_sys.executable); del _VSCODE_sys
    08:20:19.412 [trace] Executing silently Code (completed) = import sys as _VSCODE_sys\nprint(_VSCODE_sys.executable); del _VSCODE_sys with 1 output(s)
    08:20:19.413 [trace] Started running kernel initialization for Interactive-1.interactive
    08:20:19.413 [trace] Executing silently Code (idle) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy
    08:20:19.428 [trace] Executing silently Code (completed) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy with 0 output(s)
    08:20:19.428 [trace] Determined IPyWidgets Version as undefined
    08:20:19.430 [trace] Executing silently Code (idle) = import types as _VSCODE_types\nimport os\nimport hashlib as _VSCODE_hashlib\nfrom IPython import get_ip
    08:20:19.452 [trace] Executing silently Code (completed) = import types as _VSCODE_types\nimport os\nimport hashlib as _VSCODE_hashlib\nfrom IPython import get_ip with 0 output(s)
    08:20:19.453 [debug] Requesting Kernel info
    08:20:19.453 [trace] Got Kernel info
    08:20:19.453 [trace] End running kernel initialization, now waiting for idle
    08:20:19.454 [trace] Waiting for idle on (kernel): aaaafc37-01f1-4937-a639-7fa27c913198 -> idle
    08:20:19.454 [trace] Finished waiting for idle on (kernel): aaaafc37-01f1-4937-a639-7fa27c913198 -> idle
    08:20:19.454 [trace] End running kernel initialization, session is idle
    08:20:19.455 [trace] Registering Kernel Completion Provider from kernel <folder1> (Python 3.12.4) for language python
    08:20:19.456 [trace] IPyWidgetScriptSource.initialize
    08:20:19.456 [trace] Registering commtarget jupyter.widget
    08:20:19.456 [info] Kernel successfully started
    08:20:19.459 [debug] getDataDirsImpl, Class name = zr (started execution), Arg 1: "/G:/AI/<folder1>/src/operations/upload_forecasts.py", Arg 2: "~\\AppData\\Local\\miniconda3\\envs\\<folder1>\\python.exe"
    08:20:19.461 [debug] Initializing __file__ in setFileInKernel with file:///g%3A/AI/<folder1>/src/operations/upload_forecasts.py for mode multiple
    08:20:19.463 [trace] Executing silently Code (idle) = __file__ = 'g:\\AI\\<folder1>\\src\\operations\\upload_forecasts.py'
    08:20:19.466 [info] Generated code for 1 = <ipython-input-1-f34892d30725> with 5 lines
    08:20:19.470 [trace] Executing silently Code (completed) = __file__ = 'g:\\AI\\<folder1>\\src\\operations\\upload_forecasts.py' with 0 output(s)
    08:20:19.475 [trace] Cell Index:1 sent to kernel
    08:20:19.499 [info] Process Execution: ~\AppData\Local\miniconda3\envs\<folder1>\python.exe ~\.vscode\extensions\ms-toolsai.jupyter-2025.9.1-win32-x64\pythonFiles\printJupyterDataDir.py
    08:20:19.500 [debug] Start refreshing Kernel Picker (1766496019500)
    08:20:19.500 [debug] End refreshing Kernel Picker (1766496019500)
    08:20:19.507 [trace] Start cell 1 execution @ 1766496019507 (clear output)
    08:20:19.507 [debug] Kernel acknowledged execution of cell 1 @ 1766496019507
    08:20:19.509 [trace] Cell 1 completed in 0.001s (start: 1766496019507, end: 1766496019508)
    08:20:19.509 [trace] Cell 1 executed successfully
    08:20:19.642 [debug] getDataDirsImpl, Class name = zr, completed in 183ms, has a truthy return value, Arg 1: "/G:/AI/<folder1>/src/operations/upload_forecasts.py", Arg 2: "~\\AppData\\Local\\miniconda3\\envs\\<folder1>\\python.exe", Return Value: <Uri:/C:/Users/<username>/AppData/Roaming/jupyter>, <Uri:/C:/Users/<username>/AppData/Local/miniconda3/envs/<folder1>/share/jupyter>, <Uri:/C:/ProgramData/jupyter>
    08:20:25.880 [info] Generated code for 2 = <ipython-input-2-1a0695c23045> with 1 lines
    08:20:25.889 [trace] Cell Index:2 sent to kernel
    08:20:25.892 [trace] Start cell 2 execution @ 1766496025892 (clear output)
    08:20:25.892 [debug] Kernel acknowledged execution of cell 2 @ 1766496025892
    08:20:25.894 [trace] Cell 2 completed in 0.002s (start: 1766496025892, end: 1766496025894)
    08:20:25.895 [trace] Cell 2 executed successfully
    08:20:29.396 [info] Generated code for 3 = <ipython-input-3-a0d2faabd9e9> with 1 lines
    08:20:29.405 [trace] Cell Index:3 sent to kernel
    08:20:29.408 [trace] Start cell 3 execution @ 1766496029408 (clear output)
    08:20:29.408 [debug] Kernel acknowledged execution of cell 3 @ 1766496029408
    08:20:32.592 [debug] KernelProcess Exited 5904, Exit Code - 3228369023 
    08:20:32.593 [error] Disposing session as kernel process died ExitCode: 3228369023, Reason: 
    08:20:32.593 [debug] Dispose Kernel process 5904.
    08:20:32.599 [debug] Disposed Kernel process 5904.
    08:20:32.616 [trace] Cell 3 completed in -1766496029.408s (start: 1766496029408, end: undefined)
    
  6. DonJayamanne commented on Dec 24, 2025

    @DonJayamanne

    loewenm (@loewenm)
    The problem is the conda environment isn't getting activated.
    Please can you share the logs from your Python extension as well (please replicate the problem before sharing the logs, to get to the python logs, just open the Python output panel instead of Jupyter)

  7. loewenm commented on Dec 24, 2025

    @loewenm

    That sounds right: it is failing to open the correct conda environment when restarting the kernel.

    Importantly, I am able to activate this environment in CMD Prompt and run scripts, etc. However, I cannot activate it in PowerShell, which I'm assuming that VS Code is using.

    This is a fresh install and new computer. Did I forget to do something during install?

    python output only

    2025-12-24 09:33:34.639 [info] Using interpreter path: undefined
    2025-12-24 09:33:34.640 [info] Using Windows-specific commands: activate, conda activate gics_sectors_v3
    2025-12-24 09:33:34.657 [info] > activate && conda activate pytorch_env && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2025.20.1-win32-x64/python_files/printEnvVariables.py
    2025-12-24 09:33:34.658 [info] shell: commandPrompt
    2025-12-24 09:33:34.709 [error] getActivatedEnvironmentVariables [Error: Command failed: activate && conda activate pytorch_env && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python c:/Users/mloewen/.vscode/extensions/ms-python.python-2025.20.1-win32-x64/python_files/printEnvVariables.py
    'activate' is not recognized as an internal or external command,
    operable program or batch file.
    
    	at genericNodeError (node:internal/errors:983:15)
    	at wrappedFn (node:internal/errors:537:14)
    	at ChildProcess.exithandler (node:child_process:418:12)
    	at ChildProcess.emit (node:events:531:35)
    	at maybeClose (node:internal/child_process:1101:16)
    	at Socket.<anonymous> (node:internal/child_process:456:11)
    	at Socket.emit (node:events:519:28)
    	at Pipe.<anonymous> (node:net:346:12)] {
      code: 1,
      killed: false,
      signal: null,
      cmd: "activate && conda activate pytorch_env && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python c:/Users/mloewen/.vscode/extensions/ms-python.python-2025.20.1-win32-x64/python_files/printEnvVariables.py"
    }
    
  8. loewenm commented on Dec 24, 2025

    @loewenm

    Update: I figured it out - This is not a VS Code issue. My apologies.

    How to fix: In PowerShell, I needed to change ExecutionPolicy to RemoteSigned

    Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

    I'm assuming this is a change with respect to Windows 11 itself as I'm quite sure that I did not perform this action on my previous workstation.

    Thank you for your help Don Jayamanne (@DonJayamanne)

  9. eleanorjboyd commented on Jan 5, 2026

    @eleanorjboyd
    Member

    glad to hear you resolved it- happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from postertriage-neededNeeds assignment to the proper sub-team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions