Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError while trying to import project modules #12976

Closed
1 of 2 tasks
BabakAmini opened this issue Mar 1, 2023 · 16 comments
Closed
1 of 2 tasks

ModuleNotFoundError while trying to import project modules #12976

BabakAmini opened this issue Mar 1, 2023 · 16 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@BabakAmini
Copy link

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

Recently I started using GitHub codespace for the first time. I created a new codespace from one of my repositories. Assuming the folder structure as below:

my-codespace
|--- utils
|------ my_script.ipynb
|--- config.py

I get the following error when I import config.py inside my_script.ipynb:

ModuleNotFoundError: No module named 'config'

Autocomplete is working inside the editor, and it recognizes config.py while I try to import it
01

After a while red line appears indicating an error
02

All methods, classes, and variables belonging to config.py are available inside my_script.ipynb by autocomplete.

Currently, I'm using PyCharm on my computer and have no issues with that repository but I get the same error when I do the same thing on my local VS Code. Also, I had the same issue in python script instead of Jupyter notebook which was resolved by adding the following line to the settings.json file in my Windows machine:

"terminal.integrated.env.windows": {"PYTHONPATH": "${workspaceFolder}"}

and this to the Codespace version:

"terminal.integrated.env.linux": {"PYTHONPATH": "${workspaceFolder}"}

I would appreciate it if someone could help me in this regard.

VS Code Version

1.75.1

Jupyter Extension Version

2023.1.2010391206

Jupyter logs

Visual Studio Code (1.75.1, undefined, desktop)
Jupyter Extension Version: 2023.1.2010391206.
Python Extension Version: 2023.2.0.
Workspace folder y:\Programming\my-codespace
User belongs to experiment group 'jupyterTestcf'
User belongs to experiment group 'jupyterEnhancedDataViewer'
info 22:23:31.463: LSP Notebooks experiment is enabled
error 22:23:31.671: stat() failed for "C:%5CUsers%5CBabak%5CAppData%5CRoaming%5Cjupyter%5Ckernels" [Error (FileSystemError): Unable to resolve filesystem provider with relative file path 'C:\Users\Babak\AppData\Roaming\jupyter\kernels'
	at Yt.c (e:\VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:98:26311)
	at Object.stat (e:\VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:98:24412)
	at async al.exists (c:\Users\Babak\.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\out\extension.node.js:17:18028)
	at async c:\Users\Babak\.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\out\extension.node.js:17:88728] {
  code: 'Unknown'
}
info 22:23:32.464: Process Execution: > ~\AppData\Local\Programs\Python\Python310\python.exe -m pip list
> ~\AppData\Local\Programs\Python\Python310\python.exe -m pip list
info 22:25:36.319: Find preferred kernel for Untitled-1.ipynb with metadata {"orig_nbformat":4,"language_info":{"name":"python"}} & preferred interpreter c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe
info 22:25:36.321: Preferred kernel .jvsc74a57bd083d208b031a4a5a0824f5f0b47c0388aa3b94cdd004c2f68e4341ab470ede466.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.-m#ipykernel_launcher is exact match or top match for non python kernels, (true, [object Object], false, false)
info 22:25:36.321: PreferredConnection: .jvsc74a57bd083d208b031a4a5a0824f5f0b47c0388aa3b94cdd004c2f68e4341ab470ede466.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.-m#ipykernel_launcher found for NotebookDocument: Untitled-1.ipynb
info 22:25:52.401: Find preferred kernel for y:\Programming\my-codespace\utils\my_script.ipynb with metadata {"orig_nbformat":4,"language_info":{"name":"python"}} & preferred interpreter c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe
info 22:25:52.403: Preferred kernel .jvsc74a57bd083d208b031a4a5a0824f5f0b47c0388aa3b94cdd004c2f68e4341ab470ede466.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.-m#ipykernel_launcher is exact match or top match for non python kernels, (true, [object Object], false, false)
info 22:25:52.404: PreferredConnection: .jvsc74a57bd083d208b031a4a5a0824f5f0b47c0388aa3b94cdd004c2f68e4341ab470ede466.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.-m#ipykernel_launcher found for NotebookDocument: y:\Programming\my-codespace\utils\my_script.ipynb
error 22:25:59.527: Live Notebook not available for y:\Programming\my-codespace\utils\my_script.ipynb
error 22:26:03.636: Live Notebook not available for y:\Programming\my-codespace\utils\my_script.ipynb
info 22:26:08.875: Starting Jupyter Session startUsingPythonInterpreter, .jvsc74a57bd083d208b031a4a5a0824f5f0b47c0388aa3b94cdd004c2f68e4341ab470ede466.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.-m#ipykernel_launcher (Python Path: , EnvType: Unknown, EnvName: '', Version: 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]) for 'y:\Programming\my-codespace\utils\my_script.ipynb' (disableUI=false)
info 22:26:09.038: Process Execution: > ~\AppData\Local\Programs\Python\Python310\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
> ~\AppData\Local\Programs\Python\Python310\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
info 22:26:09.098: Process Execution: > ~\AppData\Local\Programs\Python\Python310\python.exe ~\.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\vscode_datascience_helpers\kernel_interrupt_daemon.py --ppid 27036
> ~\AppData\Local\Programs\Python\Python310\python.exe ~\.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\vscode_datascience_helpers\kernel_interrupt_daemon.py --ppid 27036
info 22:26:09.099: Process Execution: cwd: ~\.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\vscode_datascience_helpers
cwd: ~\.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\vscode_datascience_helpers
info 22:26:09.291: Process Execution: > ~\AppData\Local\Programs\Python\Python310\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"f6eb4cb1-4f88-43b7-a8f5-042386291fae" --shell=9002 --transport="tcp" --iopub=9004 --f=c:\Users\Babak\AppData\Roaming\jupyter\runtime\kernel-v2-27036Wn303CD37a0U.json
> ~\AppData\Local\Programs\Python\Python310\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"f6eb4cb1-4f88-43b7-a8f5-042386291fae" --shell=9002 --transport="tcp" --iopub=9004 --f=c:\Users\Babak\AppData\Roaming\jupyter\runtime\kernel-v2-27036Wn303CD37a0U.json
info 22:26:09.291: Process Execution: cwd: y:\Programming\my-codespace\utils
cwd: y:\Programming\my-codespace\utils
info 22:26:09.349: ipykernel version & path 6.2.0, ~\AppData\Local\Programs\Python\Python310\lib\site-packages\ipykernel\__init__.py for c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe
warn 22:26:11.433: StdErr from Kernel Process c:\Users\Babak\AppData\Local\Programs\Python\Python310\lib\site-packages\traitlets\traitlets.py:2196: FutureWarning: Supporting extra quotes around Unicode is deprecated in traitlets 5.0. Use 'hmac-sha256' instead of '"hmac-sha256"' – or use CUnicode.
  warn(
c:\Users\Babak\AppData\Local\Programs\Python\Python310\lib\site-packages\traitlets\traitlets.py:2151: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use 'f6eb4cb1-4f88-43b7-a8f5-042386291fae' instead of 'b"f6eb4cb1-4f88-43b7-a8f5-042386291fae"'.
  warn(

info 22:26:11.700: Started Kernel Python 3.10.10 (pid: 9344)
info 22:26:11.816: Process Execution: > ~\AppData\Local\Programs\Python\Python310\python.exe ~\.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\printJupyterDataDir.py
> ~\AppData\Local\Programs\Python\Python310\python.exe ~\.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\printJupyterDataDir.py
warn 22:26:11.943: Got a non-existent Jupyer Data Dir file:///c%3A/Users/Babak/AppData/Roaming/Python/share/jupyter
info 22:26:12.985: Cancel all remaining cells true || Error || undefined

Coding Language and Runtime Version

Python v3.10.10

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Local

@BabakAmini BabakAmini added the bug Issue identified by VS Code Team member as probable bug label Mar 1, 2023
@DonJayamanne
Copy link
Contributor

Please could you enable logging as follows:

  • Open settings & go into Jupyter->Logging
  • Change the value to verbose
  • Reload VS Code,
  • Attempt to repro the issue & then copy the output from the Jupyter output panel.

@BabakAmini
Copy link
Author

debug 23:20:14.223: VSCodeNotebookController::handleExecution, Class name = _v (started execution)
debug 23:20:14.224: Execute Cell 0 y:\Programming\my-codespace\utils\my_script.ipynb
debug 23:20:14.224: start the kernel, options.disableUI=false for y:\Programming\my-codespace\utils\my_script.ipynb
debug 23:20:14.225: Start Jupyter Session in kernel.ts with disableUI = false
info 23:20:14.225: Starting Jupyter Session startUsingPythonInterpreter, .jvsc74a57bd083d208b031a4a5a0824f5f0b47c0388aa3b94cdd004c2f68e4341ab470ede466.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.-m#ipykernel_launcher (Python Path: , EnvType: Unknown, EnvName: '', Version: 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]) for 'y:\Programming\my-codespace\utils\my_script.ipynb' (disableUI=false)
debug 23:20:14.226: Creating raw notebook for resource 'y:\Programming\my-codespace\utils\my_script.ipynb'
debug 23:20:14.226: Computing working directory for resource 'y:\Programming\my-codespace\utils\my_script.ipynb'
debug 23:20:14.228: Kernel Launcher. launch, Class name = vp (started execution), Arg 1: {"id":".jvsc74a57bd083d208b031a4a5a0824f5f0b47c0388aa3b94cdd004c2f68e4341ab470ede466.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.-m#ipykernel_launcher","kernelSpec":{"interpreterPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","isRegisteredByVSC":"registeredByNewVersionOfExt","name":"pythonjvsc74a57bd083d208b031a4a5a0824f5f0b47c0388aa3b94cdd004c2f68e4341ab470ede466","argv":["python","-m","ipykernel_launcher","-f","{connection_file}"],"language":"python","executable":"python","display_name":"Python 3","metadata":{"interpreter":{"path":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe"}},"env":{}},"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"},"path":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe"},"kind":"startUsingPythonInterpreter"}, Arg 2: 60000, Arg 3: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 4: "y:\Programming\my-codespace\utils", Arg 5: {"a":false,"b":null}
debug 23:20:14.228: Create activated Env, Class name = tc (started execution), Arg 1: {"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","_sep":1,"external":"file:///c%3A/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"}},"resource":{"$mid":1,"fsPath":"y:\Programming\my-codespace\utils\my_script.ipynb","_sep":1,"external":"file:///y%3A/Programming/my-codespace/utils/my_script.ipynb","path":"/y:/Programming/my-codespace/utils/my_script.ipynb","scheme":"file"}}
debug 23:20:14.228: Getting activated env variables, Class name = ps (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe, Arg 3: undefined
debug 23:20:14.228: Getting activated env variables impl, Class name = ps (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.228: Getting activated env variables from Python, Class name = ps (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.228: Get Custom Env Variables, Class name = bc (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunPythonCode"
debug 23:20:14.276: Get Custom Env Variables, Class name = bc, completed in 48ms, has a truthy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunPythonCode"
debug 23:20:14.287: Launching kernel in kernelProcess.ts, Class name = hp (started execution), Arg 1: "y:\Programming\my-codespace\utils", Arg 2: ""
debug 23:20:14.288: Create activated Env, Class name = tc (started execution), Arg 1: {"resource":{"$mid":1,"fsPath":"y:\Programming\my-codespace\utils\my_script.ipynb","_sep":1,"external":"file:///y%3A/Programming/my-codespace/utils/my_script.ipynb","path":"/y:/Programming/my-codespace/utils/my_script.ipynb","scheme":"file"},"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","_sep":1,"external":"file:///c%3A/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"}}}
debug 23:20:14.288: Getting activated env variables, Class name = ps (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe, Arg 3: undefined
debug 23:20:14.288: Getting activated env variables impl, Class name = ps (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.289: Getting activated env variables from Python, Class name = ps (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.289: Get Custom Env Variables, Class name = bc (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunPythonCode"
debug 23:20:14.289: Cached data exists getEnvironmentVariables, y:\Programming\my-codespace\utils\my_script.ipynb
debug 23:20:14.289: Cached custom vars data exists getCustomEnvironmentVariables, y:\Programming\my-codespace\utils\my_script.ipynb
debug 23:20:14.289: Cached custom vars data exists getCustomEnvironmentVariables, y:\Programming\my-codespace\utils\my_script.ipynb
debug 23:20:14.289: Getting activated env variables, Class name = ps (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe, Arg 3: false
debug 23:20:14.289: Getting activated env variables impl, Class name = ps (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.289: Getting activated env variables from Python, Class name = ps (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.289: Get Custom Env Variables, Class name = bc (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunPythonCode"
debug 23:20:14.289: Cached data exists getEnvironmentVariables, y:\Programming\my-codespace\utils\my_script.ipynb
debug 23:20:14.289: Cached custom vars data exists getCustomEnvironmentVariables, y:\Programming\my-codespace\utils\my_script.ipynb
debug 23:20:14.291: Get Custom Env Variables, Class name = bc, completed in 2ms, has a truthy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunPythonCode"
debug 23:20:14.294: Get Custom Env Variables, Class name = bc, completed in 5ms, has a truthy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunPythonCode"
debug 23:20:14.355: Got empty env vars with python c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe in 127ms
debug 23:20:14.355: Getting activated env variables from Python, Class name = ps, completed in 127ms, has a falsy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.355: Got env vars with python c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe in 127ms with 0 variables
debug 23:20:14.356: Getting activated env variables impl, Class name = ps, completed in 128ms, has a falsy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.356: Getting activated env variables, Class name = ps, completed in 128ms, has a falsy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe, Arg 3: undefined
debug 23:20:14.356: Create ProcessService, Class name = Ha (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb"
debug 23:20:14.356: Get Custom Env Variables, Class name = bc (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunNonPythonCode"
debug 23:20:14.358: Got empty env vars with python c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe in 69ms
debug 23:20:14.358: Getting activated env variables from Python, Class name = ps, completed in 70ms, has a falsy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.358: Got env vars with python c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe in 70ms with 0 variables
debug 23:20:14.359: Getting activated env variables impl, Class name = ps, completed in 71ms, has a falsy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.359: Getting activated env variables, Class name = ps, completed in 71ms, has a falsy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe, Arg 3: undefined
debug 23:20:14.359: Create ProcessService, Class name = Ha (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb"
debug 23:20:14.359: Get Custom Env Variables, Class name = bc (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunNonPythonCode"
debug 23:20:14.360: Got empty env vars with python c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe in 71ms
debug 23:20:14.361: Getting activated env variables from Python, Class name = ps, completed in 72ms, has a falsy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.361: Got env vars with python c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe in 72ms with 0 variables
debug 23:20:14.361: Getting activated env variables impl, Class name = ps, completed in 72ms, has a falsy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.362: Getting activated env variables, Class name = ps, completed in 73ms, has a falsy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe, Arg 3: false
debug 23:20:14.362: No custom variables nor do we have a conda environment
debug 23:20:14.367: Get Custom Env Variables, Class name = bc, completed in 11ms, has a truthy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunNonPythonCode"
debug 23:20:14.368: Create ProcessService, Class name = Ha, completed in 12ms, has a truthy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb"
debug 23:20:14.368: Creating execution process, Class name = tc, completed in 12ms, has a truthy return value, Arg 1: {"resource":{"$mid":1,"fsPath":"y:\Programming\my-codespace\utils\my_script.ipynb","_sep":1,"external":"file:///y%3A/Programming/my-codespace/utils/my_script.ipynb","path":"/y:/Programming/my-codespace/utils/my_script.ipynb","scheme":"file"},"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","_sep":1,"external":"file:///c%3A/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"}}}, Return Value: {}
debug 23:20:14.368: Create activated Env, Class name = tc, completed in 140ms, has a truthy return value, Arg 1: {"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","_sep":1,"external":"file:///c%3A/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"}},"resource":{"$mid":1,"fsPath":"y:\Programming\my-codespace\utils\my_script.ipynb","_sep":1,"external":"file:///y%3A/Programming/my-codespace/utils/my_script.ipynb","path":"/y:/Programming/my-codespace/utils/my_script.ipynb","scheme":"file"}}
info 23:20:14.371: Process Execution: > ~\AppData\Local\Programs\Python\Python310\python.exe -c "import ipykernel; print(ipykernel.version); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.file)"

~\AppData\Local\Programs\Python\Python310\python.exe -c "import ipykernel; print(ipykernel.version); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.file)"
debug 23:20:14.373: Get Custom Env Variables, Class name = bc, completed in 14ms, has a truthy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunNonPythonCode"
debug 23:20:14.374: Create ProcessService, Class name = Ha, completed in 15ms, has a truthy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb"
debug 23:20:14.374: Creating execution process, Class name = tc, completed in 15ms, has a truthy return value, Arg 1: {"resource":{"$mid":1,"fsPath":"y:\Programming\my-codespace\utils\my_script.ipynb","_sep":1,"external":"file:///y%3A/Programming/my-codespace/utils/my_script.ipynb","path":"/y:/Programming/my-codespace/utils/my_script.ipynb","scheme":"file"},"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","_sep":1,"external":"file:///c%3A/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"}}}, Return Value: {}
debug 23:20:14.374: Create activated Env, Class name = tc, completed in 86ms, has a truthy return value, Arg 1: {"resource":{"$mid":1,"fsPath":"y:\Programming\my-codespace\utils\my_script.ipynb","_sep":1,"external":"file:///y%3A/Programming/my-codespace/utils/my_script.ipynb","path":"/y:/Programming/my-codespace/utils/my_script.ipynb","scheme":"file"},"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","_sep":1,"external":"file:///c%3A/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"}}}
debug 23:20:14.375: Create activated Env, Class name = tc (started execution), Arg 1: {"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","_sep":1,"external":"file:///c%3A/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"}},"resource":{"$mid":1,"fsPath":"y:\Programming\my-codespace\utils\my_script.ipynb","_sep":1,"external":"file:///y%3A/Programming/my-codespace/utils/my_script.ipynb","path":"/y:/Programming/my-codespace/utils/my_script.ipynb","scheme":"file"}}
debug 23:20:14.375: Getting activated env variables, Class name = ps (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe, Arg 3: undefined
debug 23:20:14.375: Getting activated env variables impl, Class name = ps (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.375: Getting activated env variables from Python, Class name = ps (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.375: Get Custom Env Variables, Class name = bc (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunPythonCode"
debug 23:20:14.375: Cached data exists getEnvironmentVariables, y:\Programming\my-codespace\utils\my_script.ipynb
debug 23:20:14.375: Cached custom vars data exists getCustomEnvironmentVariables, y:\Programming\my-codespace\utils\my_script.ipynb
debug 23:20:14.377: Get Custom Env Variables, Class name = bc, completed in 2ms, has a truthy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunPythonCode"
debug 23:20:14.437: Got empty env vars with python c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe in 62ms
debug 23:20:14.437: Getting activated env variables from Python, Class name = ps, completed in 62ms, has a falsy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.437: Got env vars with python c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe in 62ms with 0 variables
debug 23:20:14.438: Getting activated env variables impl, Class name = ps, completed in 63ms, has a falsy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:14.438: Getting activated env variables, Class name = ps, completed in 63ms, has a falsy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe, Arg 3: undefined
debug 23:20:14.438: Create ProcessService, Class name = Ha (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb"
debug 23:20:14.438: Get Custom Env Variables, Class name = bc (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunNonPythonCode"
debug 23:20:14.438: Cached data exists getEnvironmentVariables, y:\Programming\my-codespace\utils\my_script.ipynb
debug 23:20:14.440: Get Custom Env Variables, Class name = bc, completed in 2ms, has a truthy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunNonPythonCode"
debug 23:20:14.440: Create ProcessService, Class name = Ha, completed in 2ms, has a truthy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb"
debug 23:20:14.440: Creating execution process, Class name = tc, completed in 2ms, has a truthy return value, Arg 1: {"resource":{"$mid":1,"fsPath":"y:\Programming\my-codespace\utils\my_script.ipynb","_sep":1,"external":"file:///y%3A/Programming/my-codespace/utils/my_script.ipynb","path":"/y:/Programming/my-codespace/utils/my_script.ipynb","scheme":"file"},"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","_sep":1,"external":"file:///c%3A/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"}}}, Return Value: {}
debug 23:20:14.441: Create activated Env, Class name = tc, completed in 66ms, has a truthy return value, Arg 1: {"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","_sep":1,"external":"file:///c%3A/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"}},"resource":{"$mid":1,"fsPath":"y:\Programming\my-codespace\utils\my_script.ipynb","sep":1,"external":"file:///y%3A/Programming/my-codespace/utils/my_script.ipynb","path":"/y:/Programming/my-codespace/utils/my_script.ipynb","scheme":"file"}}
info 23:20:14.447: Process Execution: > ~\AppData\Local\Programs\Python\Python310\python.exe ~.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\vscode_datascience_helpers\kernel_interrupt_daemon.py --ppid 30512
~\AppData\Local\Programs\Python\Python310\python.exe ~.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\vscode_datascience_helpers\kernel_interrupt_daemon.py --ppid 30512
info 23:20:14.447: Process Execution: cwd: ~.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\vscode_datascience_helpers
cwd: ~.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\vscode_datascience_helpers
debug 23:20:14.679: Got a response of 1864 for INITIALIZE_INTERRUPT:0
info 23:20:14.683: Process Execution: > ~\AppData\Local\Programs\Python\Python310\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"3b25204a-c8a2-4861-82e5-b0673bc7bc6f" --shell=9002 --transport="tcp" --iopub=9004 --f=c:\Users\Babak\AppData\Roaming\jupyter\runtime\kernel-v2-305126UHZHyUqnf2Y.json
~\AppData\Local\Programs\Python\Python310\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"3b25204a-c8a2-4861-82e5-b0673bc7bc6f" --shell=9002 --transport="tcp" --iopub=9004 --f=c:\Users\Babak\AppData\Roaming\jupyter\runtime\kernel-v2-305126UHZHyUqnf2Y.json
info 23:20:14.683: Process Execution: cwd: y:\Programming\my-codespace\utils
cwd: y:\Programming\my-codespace\utils
debug 23:20:14.684: Launching kernel in kernelProcess.ts, Class name = hp, completed in 397ms, has a truthy return value, Arg 1: "y:\Programming\my-codespace\utils", Arg 2: ""
info 23:20:14.754: ipykernel version & path 6.2.0, ~\AppData\Local\Programs\Python\Python310\lib\site-packages\ipykernel_init
.py for c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe
debug 23:20:16.042: KernelProcess error: c:\Users\Babak\AppData\Local\Programs\Python\Python310\lib\site-packages\traitlets\traitlets.py:2196: FutureWarning: Supporting extra quotes around Unicode is deprecated in traitlets 5.0. Use 'hmac-sha256' instead of '"hmac-sha256"' – or use CUnicode.
warn(
c:\Users\Babak\AppData\Local\Programs\Python\Python310\lib\site-packages\traitlets\traitlets.py:2151: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '3b25204a-c8a2-4861-82e5-b0673bc7bc6f' instead of 'b"3b25204a-c8a2-4861-82e5-b0673bc7bc6f"'.
warn(

warn 23:20:16.043: StdErr from Kernel Process c:\Users\Babak\AppData\Local\Programs\Python\Python310\lib\site-packages\traitlets\traitlets.py:2196: FutureWarning: Supporting extra quotes around Unicode is deprecated in traitlets 5.0. Use 'hmac-sha256' instead of '"hmac-sha256"' – or use CUnicode.
warn(
c:\Users\Babak\AppData\Local\Programs\Python\Python310\lib\site-packages\traitlets\traitlets.py:2151: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '3b25204a-c8a2-4861-82e5-b0673bc7bc6f' instead of 'b"3b25204a-c8a2-4861-82e5-b0673bc7bc6f"'.
warn(

debug 23:20:16.134: KernelProcess output: NOTE: When using the ipython kernel entry point, Ctrl-C will not work.

To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.

To read more about this, see ipython/ipython#2049

To connect another client to this kernel, use:
--existing c:\Users\Babak\AppData\Roaming\jupyter\runtime\kernel-v2-305126UHZHyUqnf2Y.json

debug 23:20:16.134: Kernel Output: To connect another client to this kernel, use: --existing c:\Users\Babak\AppData\Roaming\jupyter\runtime\kernel-v2-305126UHZHyUqnf2Y.json

debug 23:20:16.154: Kernel Launcher. launch, Class name = vp, completed in 1925ms, has a truthy return value, Arg 1: {"id":".jvsc74a57bd083d208b031a4a5a0824f5f0b47c0388aa3b94cdd004c2f68e4341ab470ede466.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe.-m#ipykernel_launcher","kernelSpec":{"interpreterPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","isRegisteredByVSC":"registeredByNewVersionOfExt","name":"pythonjvsc74a57bd083d208b031a4a5a0824f5f0b47c0388aa3b94cdd004c2f68e4341ab470ede466","argv":["python","-m","ipykernel_launcher","-f","{connection_file}"],"language":"python","executable":"python","display_name":"Python 3","metadata":{"interpreter":{"path":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe"}},"env":{}},"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"},"path":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe"},"kind":"startUsingPythonInterpreter"}, Arg 2: 60000, Arg 3: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 4: "y:\Programming\my-codespace\utils", Arg 5:
debug 23:20:16.200: Waiting for Raw Session to be ready in postStartRawSession
debug 23:20:16.200: Waiting for Raw session to be ready, currently connected
debug 23:20:16.200: Raw session connected
debug 23:20:16.200: Waiting for Raw session to be ready for 30s
debug 23:20:16.201: Waited for Raw session to be ready & got connected
debug 23:20:16.201: Successfully waited for Raw Session to be ready in postStartRawSession
debug 23:20:16.201: Kernel status before requesting kernel info and after ready is unknown
debug 23:20:16.201: Sending request for kernelinfo
debug 23:20:16.375: Got response for requestKernelInfo
debug 23:20:16.375: Successfully compelted postStartRawSession
info 23:20:16.377: Started Kernel Python 3.10.10 (pid: 4728)
debug 23:20:16.380: Started running kernel initialization for y:\Programming\my-codespace\utils\my_script.ipynb
debug 23:20:16.385: Executing silently Code (idle) = import os as _VSCODE_os\nimport sys as _VSCODE_sys\n%cd "y:\Programming\my-codespace\utils"\nif _VSCODE
debug 23:20:16.440: Executing silently Code (completed) = import os as _VSCODE_os\nimport sys as _VSCODE_sys\n%cd "y:\Programming\my-codespace\utils"\nif _VSCODE with 1 output(s)
debug 23:20:16.441: Not executing startup session: Object, code:
debug 23:20:16.441: Requesting Kernel info
debug 23:20:16.442: Got Kernel info
debug 23:20:16.442: End running kernel initialization, now waiting for idle
debug 23:20:16.443: Waiting for 60000ms idle on (kernel): 9126ff45-a34e-4ca0-a34d-60af606cb5e4 -> idle
debug 23:20:16.444: Finished waiting for idle on (kernel): 9126ff45-a34e-4ca0-a34d-60af606cb5e4 -> idle
debug 23:20:16.445: End running kernel initialization, session is idle
debug 23:20:16.448: IPyWidgetScriptSource.initialize
debug 23:20:16.449: IPyWidgetMessageDispatcher.initialize
debug 23:20:16.450: getDataDirsImpl, Class name = Lu (started execution), Arg 1: {"resource":{"$mid":1,"fsPath":"y:\Programming\my-codespace\utils\my_script.ipynb","_sep":1,"external":"file:///y%3A/Programming/my-codespace/utils/my_script.ipynb","path":"/y:/Programming/my-codespace/utils/my_script.ipynb","scheme":"file"},"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","_sep":1,"external":"file:///c%3A/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"}}}
debug 23:20:16.451: Get Custom Env Variables, Class name = bc (started execution), Arg 1: undefined, Arg 2: "RunPythonCode"
debug 23:20:16.451: Cached data exists getEnvironmentVariables, y:\Programming\my-codespace
debug 23:20:16.452: Get Custom Env Variables, Class name = bc, completed in 1ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
debug 23:20:16.454: Get Jupyter Sub Paths, Class name = Lu, completed in 3ms, has a truthy return value, Arg 1: undefined, Return Value:
debug 23:20:16.454: Get Jupyter Paths, Class name = Lu, completed in 3ms, has a truthy return value, , Return Value:
debug 23:20:16.454: Create activated Env, Class name = tc (started execution), Arg 1: {"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","_sep":1,"external":"file:///c%3A/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"}},"resource":{"$mid":1,"fsPath":"y:\Programming\my-codespace\utils\my_script.ipynb","_sep":1,"external":"file:///y%3A/Programming/my-codespace/utils/my_script.ipynb","path":"/y:/Programming/my-codespace/utils/my_script.ipynb","scheme":"file"},"allowEnvironmentFetchExceptions":true}
debug 23:20:16.454: Getting activated env variables, Class name = ps (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe, Arg 3: true
debug 23:20:16.455: Getting activated env variables impl, Class name = ps (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:16.455: Getting activated env variables from Python, Class name = ps (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:16.455: Get Custom Env Variables, Class name = bc (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunPythonCode"
debug 23:20:16.455: Cached data exists getEnvironmentVariables, y:\Programming\my-codespace\utils\my_script.ipynb
debug 23:20:16.455: Cached custom vars data exists getCustomEnvironmentVariables, y:\Programming\my-codespace\utils\my_script.ipynb
debug 23:20:16.458: Get Custom Env Variables, Class name = bc, completed in 3ms, has a truthy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunPythonCode"
debug 23:20:16.463: Start Jupyter Session in kernel.ts with disableUI = false
debug 23:20:16.468: Start cell 0 execution @ 1677700216468
debug 23:20:16.471: Widget Message: Received IPyWidgets_kernelOptions in ScriptManager
debug 23:20:16.471: Widget Message: Received IPyWidgetMessages.IPyWidgets_kernelOptions
debug 23:20:16.528: IPyWidgetMessageDispatcher.initialize
debug 23:20:16.550: IPyWidgetMessageDispatcher.initialize
debug 23:20:16.661: Got empty env vars with python c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe in 206ms
debug 23:20:16.662: Getting activated env variables from Python, Class name = ps, completed in 207ms, has a falsy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:16.662: Got env vars with python c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe in 207ms with 0 variables
debug 23:20:16.663: Getting activated env variables impl, Class name = ps, completed in 209ms, has a falsy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe
debug 23:20:16.663: Getting activated env variables, Class name = ps, completed in 209ms, has a falsy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: Uri:/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe, Arg 3: true
debug 23:20:16.663: Create ProcessService, Class name = Ha (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb"
debug 23:20:16.663: Get Custom Env Variables, Class name = bc (started execution), Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunNonPythonCode"
debug 23:20:16.663: Cached data exists getEnvironmentVariables, y:\Programming\my-codespace\utils\my_script.ipynb
debug 23:20:16.664: Get Custom Env Variables, Class name = bc, completed in 1ms, has a truthy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb", Arg 2: "RunNonPythonCode"
debug 23:20:16.664: Create ProcessService, Class name = Ha, completed in 1ms, has a truthy return value, Arg 1: "/y:/Programming/my-codespace/utils/my_script.ipynb"
debug 23:20:16.664: Creating execution process, Class name = tc, completed in 1ms, has a truthy return value, Arg 1: {"resource":{"$mid":1,"fsPath":"y:\Programming\my-codespace\utils\my_script.ipynb","_sep":1,"external":"file:///y%3A/Programming/my-codespace/utils/my_script.ipynb","path":"/y:/Programming/my-codespace/utils/my_script.ipynb","scheme":"file"},"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","_sep":1,"external":"file:///c%3A/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"}}}, Return Value: {}
debug 23:20:16.664: Create activated Env, Class name = tc, completed in 210ms, has a truthy return value, Arg 1: {"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","_sep":1,"external":"file:///c%3A/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"}},"resource":{"$mid":1,"fsPath":"y:\Programming\my-codespace\utils\my_script.ipynb","_sep":1,"external":"file:///y%3A/Programming/my-codespace/utils/my_script.ipynb","path":"/y:/Programming/my-codespace/utils/my_script.ipynb","scheme":"file"},"allowEnvironmentFetchExceptions":true}
info 23:20:16.668: Process Execution: > ~\AppData\Local\Programs\Python\Python310\python.exe ~.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\printJupyterDataDir.py

~\AppData\Local\Programs\Python\Python310\python.exe ~.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\printJupyterDataDir.py
warn 23:20:16.772: Got a non-existent Jupyer Data Dir file:///c%3A/Users/Babak/AppData/Roaming/Python/share/jupyter
debug 23:20:16.773: getDataDirsImpl, Class name = Lu, completed in 323ms, has a truthy return value, Arg 1: {"resource":{"$mid":1,"fsPath":"y:\Programming\my-codespace\utils\my_script.ipynb","_sep":1,"external":"file:///y%3A/Programming/my-codespace/utils/my_script.ipynb","path":"/y:/Programming/my-codespace/utils/my_script.ipynb","scheme":"file"},"interpreter":{"id":"C:\USERS\BABAK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON310\PYTHON.EXE","sysPrefix":"C:\Users\Babak\AppData\Local\Programs\Python\Python310","displayPath":{"$mid":1,"path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\Users\Babak\AppData\Local\Programs\Python\Python310\python.exe","_sep":1,"external":"file:///c%3A/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","path":"/C:/Users/Babak/AppData/Local/Programs/Python/Python310/python.exe","scheme":"file"},"displayName":"","envType":"Unknown","version":{"major":3,"minor":10,"patch":10,"raw":"3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]"}}}
debug 23:20:16.810: Widget Message: data-base-url set to https://file%2B.vscode-resource.vscode-cdn.net/c%3A/Users/Babak/.vscode/extensions/ms-toolsai.jupyter-2023.1.2010391206/tmp/scripts/bf9810a3863f5c0d7a0d457df53ef29d76a7337a805a2244a28f867921bfef32/jupyter
debug 23:20:17.522: End cell 0 execution @ 1677700217522, started @ 1677700216468, elapsed time = 1.054s
info 23:20:17.522: Cancel all remaining cells true || Error || undefined
debug 23:20:17.522: Cancel pending cells
debug 23:20:17.523: Cell 0 executed with state Error
debug 23:20:17.523: VSCodeNotebookController::handleExecution, Class name = _v, completed in 3300ms, has a falsy return value

@BabakAmini
Copy link
Author

Please note that I did the above procedure on my local VS Code. Let me know if I should do the same thing or something else on the GitHub editor.

@DonJayamanne
Copy link
Contributor

Please could you upload all of the logs, the logs you uploaded are missing a lot of information.

Please re-load vscode, and replicate the issue and then copy the logs

@BabakAmini
Copy link
Author

Sorry for the misunderstanding.

1.txt

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Mar 2, 2023

You need to create a .env file with the following value

PYTHONPATH=<Fully qualified path to your directory>

Ideally you should be able to just add the following, however that does not work right now due to microsoft/vscode-python#20784

PYTHONPATH=./

@BabakAmini
Copy link
Author

That workaround didn't work for me

image

But it worked when I used my project path as PYTHONPATH!!!

image

I tried this on my local machine but since ${workspaceFolder} doesn't work in env file, I don't know how to apply this solution to github workspace.

@BabakAmini
Copy link
Author

@DonJayamanne do you have any idea?

@DonJayamanne
Copy link
Contributor

@BabakAmini
You must set the path to the project path and not the post to python env
In python 'PYTHONPATH' is an additional path augmentation for modules,
Ie is not something invented by vscode

machine but since ${workspaceFolder} doesn't work in env file, I don't know how to apply this solution to github workspace.

What do you mean by GitHub workspace

@BabakAmini
Copy link
Author

@DonJayamanne

I've already set PYTHONPATH on my Windows machine but local VS Code didn't work with that approach.

This is a summary of what I did until now:

A- For VS Code on my local Windows machine:

  • I have to add the following lines to the \user\settings.json file to get Python files in subfolders working:
    "terminal.integrated.env.windows": {
        "PYTHONPATH": "${workspaceFolder}"
    }
  • I also have to add PYTHONPATH=Y:\Programming\my-codespace to the .env file inside the project's root folder to get Jupyter notebooks in subfolders working.

B- For the GitHub codespace version I tried to do the same things as above:

  • Adding Linux version (terminal.integrated.env.linux) to the settings.json file to make Python files in subfolders works without any issues.
  • Adding PYTHONPATH=${PYTHONPATH}:${workspaceFolder} to the .env file doesn't help to run Jupyter notebooks inside subfolders and I get an importing error yet.

I can confirm that PYTHONPATH has the right values by running print(os.environ).

@DonJayamanne
Copy link
Contributor

@BabakAmini
I'm confused, please can we focus on one environment at a time.
You seem to be trying codespaces as well we local windows.

Lets focus on windows for now
Is A- For VS Code on my local Windows machine: this approach working for you?

@DonJayamanne DonJayamanne added the info-needed Issue requires more information from poster label Mar 29, 2023
@BabakAmini
Copy link
Author

@DonJayamanne

Setting the path to the project path didn't work for me. Instead, I had to do those two steps in section "A" I mentioned before - one for the Python scripts (.py files) and the other one for the Jupyter notebooks.

@DonJayamanne
Copy link
Contributor

I had to do those two steps in section "A" I mentioned before

Yes, that is the solution and that is expected.
The changes to user/settings.json is only required when running code in the terminal.

Now that we know local window works, lets move onto Code spaces,
Please can you let me know whether this work or not.

@DonJayamanne
Copy link
Contributor

Closing this issue as its been over 4 weeks, since the information was requested.
We'll be happy to reopen the issue when the requested information has been provided.

@BabakAmini
Copy link
Author

I had to do those two steps in section "A" I mentioned before

Yes, that is the solution and that is expected. The changes to user/settings.json is only required when running code in the terminal.

Now that we know local window works, lets move onto Code spaces, Please can you let me know whether this work or not.

As I said before, for the GitHub codespace version I did the same procedure as the local version. Python files work as expected but Jupyter Notebooks fail.

@DonJayamanne
Copy link
Contributor

Python files work as expected but Jupyter Notebooks fail.

However thats in the terminal, and that doesn't apply, thats the same as running this outside vscode with the env variables configured for a terminal

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants