23

This is the error message displayed when I run the code in Interactive window in vs code:

C:\Users\rohit\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.py:2195: 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\rohit\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.py:2150: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '8fe74386-11f1-4831-b37d-5582442edf8a' instead of 'b"8fe74386-11f1-4831-b37d-5582442edf8a"'. warn( Traceback (most recent call last): File "c:\Users\rohit.vscode\extensions\ms-toolsai.jupyter-2021.5.702919634\pythonFiles\vscode_datascience_helpers..\pyvsc-run-isolated.py", line 30, in runpy.run_path(module, run_name="main") File "F:\Anaconda\lib\runpy.py", line 265, in run_path return _run_module_code(code, init_globals, run_name, File "F:\Anaconda\lib\runpy.py", line 97, in _run_module_code _r...


I tried re-installing VS code (In another DRIVE F:). I am using python(conda) interpreter.

4
  • Same error here: ` Kernel died with exit code 1. Traceback (most recent call last): File "C:\Users\ryan\Miniconda3\envs\col1\lib\runpy.py", line 193, in run_module_as_main "main", mod_spec) File "C:\Users\ryan\Miniconda3\envs\col1\lib\runpy.py", line 85, in _run_code exec(code, run_globals) ... File "C:\Users\ryan\Miniconda3\envs\col1\lib\site-packages\zmq\backend\cython__init_.py", line 6, in <module> from . import (constants, error, message, context, ImportError: DLL load failed: The specified module could not be found. ` Commented Apr 16, 2021 at 6:11
  • I tried reinstalling anaconda and vscode. Commented Apr 17, 2021 at 15:48
  • and also try running vscode from anaconda prompt shell with admin privileges.. type 'code' in the shell and hit enter. VSCode automatically starts and then press Ctrl+Shift+P amd select python(conda) interpreter. This worked for me. Commented Apr 17, 2021 at 15:52
  • Thanks. The issue was resolved on its own. Maybe it was because the Conda environment was just created and VS Code for some reason couldn't start Jupyter notebook. Once I started Jupyter notebook from conda, it may have resolved the issue for VS Code too. Commented Apr 20, 2021 at 3:12

10 Answers 10

10

Also a solution here:

conda install ipykernel --update-deps --force-reinstall
Sign up to request clarification or add additional context in comments.

Comments

7

This fix it from terminal

pip install pywin32==228

2 Comments

ERROR: Could not find a version that satisfies the requirement pywin32==228 (from versions: 302, 303, 304)
@sebas just use on of the list that error gived, like pip install pywin32==306
3

Issue:

Kernel died with exit code 1073741845.

1. c:\anaconda\envs\my_env\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.

2. warn( c:\anaconda\envs\my_env\lib\site-packages\traitlets\traitlets.py:2151: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '7aa5b615-129a-4e47-b483-0954be3b7001' instead of 'b"7aa5b615-129a-4e47-b483-0954be3b7001"'.

3. warn( Bad file descriptor (bundled\zeromq\src\epoll.cpp:100)

Solution:

To solve 1. & 2. using the following commend in vscode python terminal:

python -m pip install traitlets==4.3.3 --force-reinstall (maybe need run 2 times and shows successfully install)

just reinstall the traitlets to the lower version.

To solve 3. using the following commend in vscode python terminal:

python -m pip install pyzmq==19.0.2 --force-reinstall (maybe need run 2 times and shows successfully install)

just reinstall the pyzmq to the lower version.

2 Comments

This should be the right solution.
This didn't work for me. Another package fails with error saying it requires traitlets>=5 version to run.
3

1-Open Vs code choose your Kernal and Reinstall ipykenel

(Don't press anything keep reinstall till it works) Keep your kernal open while you doing this step by opening any notebook in the browser using Jupiter notebook normally And it will Work

or

Go to terminal open it as admin.

  • conda activate base
  • conda install --name base ipykernel -y
  • refresh the kernel by opening the jupyter note book from vscode terminal
  • -Choose the kernal you updated with ipykernel in vscode

this worked for me

Comments

2

In addition to what THE TECHIE HAND recommended- I opened a python terminal in VS Code and launched jupyter notebook from there. It opened in my web browser and allowed me to set a python 3 kernel, which then enabled Jupyter to work in VS Code.

Comments

2

Open your VS code, uninstall Python and Jupyter extensions and reinstall them again.

Comments

0

I fixed this by:

  1. Opening Anaconda Navigator
  2. Switching to the correct conda environment with the menu at the top
  3. Opening VS Code from the Anaconda navigator

For some reason, this made the interactive window work again.

Comments

0

This problem has occured to me as well , In my case I had code.py file removing it had seemed to have solved my problem

Comments

0

Had the same issue with VS Code. Issue got fixed by

  1. Uninstalling Anaconda
  2. Removing Anaconda from /opt and ~/opt (credits / video)
  3. Reinstalling Anaconda.

Important Note - I assume this issue was with IPython 8.1.1. After reinstall from an existing package the version changed to 7.29.0 with Python 3.9.7 and it works.

Comments

0

In my case it was the fact that I was using a python installation via the Microsoft Store which installs it into AppData/Local/... which I am guessing is problematic if VSCode tries to access it.

I solved it by installing python via chocolatey, however, there might be other solutions as well.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.