Open Memie1 opened 1 week ago
Thank you for filing this issue and sorry you are running into this.
Please could you enable logging as follows:
Jupyter->Logging
trace
Jupyter
output panel (use the command Jupyter: Show Output
to get to the logs).I think i did it correctly.
Does this give more info? I have tried a few more things to get it working this afternoon but no progress. I'm thinking this may be a problem with visual studio. I also recently tried changing the version of pylance I'm using but i don't think that did anything.
Tried with python 3.12.7 too just now. It's still saying there it can't find ipykernel. I've checked the file (screenshot below), i see a lot relating to jupyter so i think it installed correctly. I've even forced the install of ipykernal before sending this just now and nothing changed.
/
Please can you share the complete log, not just the errors. I'd like to see everything from the start to the end.
Okay,
This is everything in the output (after clearing the log and trying to start a cell). Sorry it's presented messy, I'm not too sure how to make this to look any nicer on github
`01:32:57.287 [debug] Handle Execution of Cells 2 for i:\CodeProjects\TrackingPlanets\TrackingPlanets.ipynb 01:32:57.287 [trace] Execute Notebook i:\CodeProjects\TrackingPlanets\TrackingPlanets.ipynb. Step 1 01:32:57.288 [trace] Connect to Kernel i:\CodeProjects\TrackingPlanets\TrackingPlanets.ipynb. Step 2 01:32:57.288 [debug] start the kernel, options.disableUI=false for i:\CodeProjects\TrackingPlanets\TrackingPlanets.ipynb 01:32:57.289 [info] Starting Kernel (Python Path: ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe, Unknown, 3.12.7) for 'i:\CodeProjects\TrackingPlanets\TrackingPlanets.ipynb' (disableUI=false) 01:32:57.289 [trace] Creating raw notebook for resource 'i:\CodeProjects\TrackingPlanets\TrackingPlanets.ipynb' 01:32:57.303 [info] Process Execution: ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe -c "import ipykernel; print(ipykernel.version); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.file)" 01:32:57.361 [debug] Launching kernel .jvsc74a57bd0559d8e864d10a8296c885f7a84e1edb640b424062f06a1fd2a0ea1a7c9f72ab9.c:\Users\~\AppData\Local\Microsoft\WindowsApps\python3.12.exe.c:\Users\~\AppData\Local\Microsoft\WindowsApps\python3.12.exe.-m#ipykernel_launcher for i:\CodeProjects\TrackingPlanets\TrackingPlanets.ipynb in i:\CodeProjects\TrackingPlanets with ports 9065, 9064, 9068, 9066, 9067 01:32:57.363 [info] Adding env Variable PYTHONNOUSERSITE to ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe 01:32:57.363 [trace] Got a response of 2604 for INITIALIZE_INTERRUPT:16 01:32:57.386 [info] Process Execution: ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe -m ipykernel_launcher --f=c:\Users\~\AppData\Roaming\jupyter\runtime\kernel-v344cf225fca57a0cd037e5ca9dfe6ad290841fced.json
cwd: i:\CodeProjects\TrackingPlanets 01:32:57.387 [debug] Kernel process 15456. 01:32:57.476 [debug] KernelProcess error 15456: C:\Users\~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe: No module named ipykernel_launcher
01:32:57.481 [debug] KernelProcess Exited 15456, Exit Code - 1 C:\Users\~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe: No module named ipykernel_launcher
01:32:57.482 [error] Disposing kernel process due to an error Ll [Error]: The kernel died. Error: C:\Users\~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe: No module named ipykernel_launcher... View Jupyter log for further details.
at ChildProcess.
Thank you
This is everything in the output (after clearing the log and trying to start a cell).
Please could you instead, reload vscode and run the cell and share the logs from the beginning
Oh i understand now my bad.
Here it is:
Visual Studio Code (1.94.2, undefined, desktop) Jupyter Extension Version: 2024.9.1. Python Extension Version: 2024.16.1. Pylance Extension Version: 2023.10.40. Platform: win32 (x64). Temp Storage folder ~\AppData\Roaming\Code\User\globalStorage\ms-toolsai.jupyter\version-2024.9.1 Workspace folder i:\CodeProjects\TrackingPlanets, Home = c:\Users{me} 13:35:41.802 [debug] Start refreshing Kernel Picker (1728909341802) 13:35:41.894 [trace] Search for KernelSpecs in Interpreter ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe 13:35:41.901 [trace] Search for KernelSpecs in Interpreter ~\AppData\Local\Microsoft\WindowsApps\python3.9.exe 13:35:41.901 [trace] Search for KernelSpecs in Interpreter i:\CodeProjects\TrackingPlanets\myenv\Scripts\python.exe 13:35:41.902 [trace] Search for KernelSpecs in Interpreter i:\CodeProjects\TrackingPlanets.venv\Scripts\python.exe 13:35:41.903 [debug] Get Custom Env Variables, Class name = Cm, completed in 102ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode" 13:35:41.903 [debug] Jupyter Paths kernels: 13:35:41.903 [debug] Kernel Spec Root Paths, ~\AppData\Roaming\jupyter\kernels, c:\ProgramData\jupyter\kernels 13:35:41.940 [trace] No controller, hence notebook communications cannot be initialized for editor i:\CodeProjects\TrackingPlanets\TrackingPlanets.ipynb 13:35:41.941 [debug] Start refreshing Interpreter Kernel Picker 13:35:43.075 [debug] KernelProvider switched kernel to id = .jvsc74a57bd0559d8e864d10a8296c885f7a84e1edb640b424062f06a1fd2a0ea1a7c9f72ab9.c:\Users\~\AppData\Local\Microsoft\WindowsApps\python3.12.exe.c:\Users\~\AppData\Local\Microsoft\WindowsApps\python3.12.exe.-m#ipykernel_launcher 13:35:43.076 [debug] start the kernel, options.disableUI=true for i:\CodeProjects\TrackingPlanets\TrackingPlanets.ipynb 13:35:43.101 [trace] Registering commtarget jupyter.widget 13:35:43.105 [debug] Controller selection change completed 13:35:43.356 [debug] Get Custom Env Variables, Class name = Cm, completed in 1ms, has a truthy return value, Arg 1: "/i:/CodeProjects/TrackingPlanets", Arg 2: "RunPythonCode" 13:35:43.356 [info] Starting Kernel (Python Path: ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe, Unknown, 3.12.7) for 'i:\CodeProjects\TrackingPlanets\TrackingPlanets.ipynb' (disableUI=true) 13:35:43.357 [trace] Creating raw notebook for resource 'i:\CodeProjects\TrackingPlanets\TrackingPlanets.ipynb' 13:35:44.858 [debug] Get Custom Env Variables, Class name = Cm, completed in 3ms, has a truthy return value, Arg 1: "/i:/CodeProjects/TrackingPlanets/TrackingPlanets.ipynb", Arg 2: "RunPythonCode" 13:35:44.934 [trace] Hiding default KernelSpec python for interpreter i:\CodeProjects\TrackingPlanets\myenv\Scripts\python.exe (KernelSpec file i:\CodeProjects\TrackingPlanets\myenv\share\jupyter\kernels\python3\kernel.json) 13:35:44.935 [trace] Hiding default KernelSpec python for interpreter i:\CodeProjects\TrackingPlanets.venv\Scripts\python.exe (KernelSpec file i:\CodeProjects\TrackingPlanets.venv\share\jupyter\kernels\python3\kernel.json) 13:35:45.627 [trace] Conda file is conda 13:35:45.645 [debug] Launching kernel .jvsc74a57bd0559d8e864d10a8296c885f7a84e1edb640b424062f06a1fd2a0ea1a7c9f72ab9.c:\Users\~\AppData\Local\Microsoft\WindowsApps\python3.12.exe.c:\Users\~\AppData\Local\Microsoft\WindowsApps\python3.12.exe.-m#ipykernel_launcher for i:\CodeProjects\TrackingPlanets\TrackingPlanets.ipynb in i:\CodeProjects\TrackingPlanets with ports 9001, 9000, 9004, 9002, 9003 13:35:45.660 [warn] Failed to get activated env vars for ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe in 2305ms 13:35:45.661 [debug] Create ProcessService, Class name = Sm (started execution), Arg 1: undefined 13:35:45.663 [warn] Failed to get activated env vars for ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe in 808ms 13:35:45.664 [debug] Get Custom Env Variables, Class name = Cm, completed in 3ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunNonPythonCode", Arg 3: undefined 13:35:45.665 [debug] Create ProcessService, Class name = Sm, completed in 4ms, has a truthy return value, Arg 1: undefined 13:35:45.721 [info] Process Execution: ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe -c "import site;print("USER_BASE_VALUE");print(site.USER_SITE);print("USER_BASE_VALUE");" 13:35:45.827 [trace] USER_SITE for ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe is c:\Users\~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\Scripts 13:35:45.829 [trace] Prepend PATH with user site path for ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe, user site c:\Users\~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\Scripts 13:35:45.829 [trace] Prepend PATH with python bin for ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe 13:35:45.830 [trace] Prepend PATH with user site path for ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe, user site c:\Users\~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\Scripts 13:35:45.830 [trace] Prepend PATH with python bin for ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe 13:35:45.831 [debug] Getting activated env variables, Class name = gd, completed in 2476ms, has a truthy return value, Arg 1: "/i:/CodeProjects/TrackingPlanets", Arg 2: "~\APPDATA\LOCAL\MICROSOFT\WINDOWSAPPS\PYTHON3.12.EXE", Arg 3: undefined 13:35:45.831 [debug] Getting activated env variables, Class name = gd, completed in 976ms, has a truthy return value, Arg 1: "/i:/CodeProjects/TrackingPlanets/TrackingPlanets.ipynb", Arg 2: "~\APPDATA\LOCAL\MICROSOFT\WINDOWSAPPS\PYTHON3.12.EXE", Arg 3: undefined 13:35:45.852 [info] Process Execution: ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe -m pip list 13:35:45.883 [info] Process Execution: ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe -c "import ipykernel; print(ipykernel.version); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.file)" 13:35:45.903 [info] Process Execution: ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe c:\Users\~.vscode\extensions\ms-toolsai.jupyter-2024.9.1-win32-x64\pythonFiles\vscode_datascience_helpers\kernel_interrupt_daemon.py --ppid 31360
cwd: ~.vscode\extensions\ms-toolsai.jupyter-2024.9.1-win32-x64\pythonFiles\vscode_datascience_helpers 13:35:45.904 [info] Adding env Variable PYTHONNOUSERSITE to ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe 13:35:46.226 [trace] Got a response of 1552 for INITIALIZE_INTERRUPT:0 13:35:46.249 [info] Process Execution: ~\AppData\Local\Microsoft\WindowsApps\python3.12.exe -m ipykernel_launcher --f=c:\Users\~\AppData\Roaming\jupyter\runtime\kernel-v32755f01532e79195c642e40a7223653ecc5c2aee.json cwd: i:\CodeProjects\TrackingPlanets 13:35:46.249 [debug] Kernel process 27804. 13:35:46.388 [debug] KernelProcess error 27804: C:\Users\~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe: No module named ipykernel_launcher
13:35:46.389 [debug] KernelProcess Exited 27804, Exit Code - 1 C:\Users\~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe: No module named ipykernel_launcher
13:35:46.390 [error] Disposing kernel process due to an error Ll [Error]: The kernel died. Error: C:\Users\~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe: No module named ipykernel_launcher... View Jupyter log for further details.
at ChildProcess.
cwd: i:\CodeProjects\TrackingPlanets 13:37:25.283 [debug] Kernel process 30492. 13:37:25.351 [debug] KernelProcess error 30492: C:\Users\~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe: No module named ipykernel_launcher
13:37:25.356 [debug] KernelProcess Exited 30492, Exit Code - 1 C:\Users\~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe: No module named ipykernel_launcher
13:37:25.356 [error] Disposing kernel process due to an error Ll [Error]: The kernel died. Error: C:\Users\~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe: No module named ipykernel_launcher... View Jupyter log for further details.
at ChildProcess.
I FINALLY DID IT
It still seems somewhat buggy and the files in my project look pretty messy. More importantly it works though.
What I did was kinda confusing but i uninstalled all versions of python, got the latest (and definitely not from the Microsoft store this time) version of python
Even then it confusingly didn't work after creating a new environment but I used these commands from Copilot
python -m venv myenv myenv\Scripts\activate
pip install numpy pip install ipykernel
python -m ipykernel install --user --name myenv --display-name "Python 3 (myenv)"
got an error so did this pip uninstall pyzmq pip install pyzmq
reloaded the project and it works. The only thing is i have to have the .venv in my project, which i previously didn't need for it to work. Is there a way to get rid of it? I definitely do not understand jupyter much but when it works i really love it.
Environment data
Expected behaviour
The python kernel to work. I've ran pip force install like it asks
Actual behaviour
Running cells with 'Python 3.9.13' requires the ipykernel package. Run the following command to install 'ipykernel' into the Python environment. Command: 'c:/Users/{user}/AppData/Local/Microsoft/WindowsApps/python3.9.exe -m pip install ipykernel -U --user --force-reinstall'
I have tried it with a non microsoft store version of python too.
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
Logs
Output for
Jupyter
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toJupyter
)``` 00:32:22.425 [error] Error in execution (get message for cell) Error: The kernel died. Error: C:\Users\~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe: No module named ipykernel_launcher... View Jupyter [log](command:jupyter.viewOutput) for further details. > Kernel Id = .jvsc74a57bd0dfe038eecb874360894ce776203bb4915e5178ab37b222d416b3884fedf0d40a.c:\Users\~\AppData\Local\Microsoft\WindowsApps\python3.9.exe.c:\Users\~\AppData\Local\Microsoft\WindowsApps\python3.9.exe.-m#ipykernel_launcher > Interpreter Id = c:\USERS\~\APPDATA\LOCAL\MICROSOFT\WINDOWSAPPS\PYTHON3.9.EXE > at ChildProcess. (c:\Users\~\.vscode\extensions\ms-toolsai.jupyter-2024.9.1-win32-x64\dist\extension.node.js:299:44598)
> stdErr = C:\Users\~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe: No module named ipykernel_launcher
00:32:22.437 [info] Process Execution: ~\AppData\Local\Microsoft\WindowsApps\python3.9.exe -c "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
```