Vscode-jupyter: Failed to start a session for the Kernel 'Python 3.5.2 64-bit ('root': conda)'. View Jupyter log for further details.

Created on 25 Mar 2020  Â·  14Comments  Â·  Source: microsoft/vscode-jupyter

Environment data

  • VS Code version: 1.43.1
  • Extension version (available under the Extensions sidebar): XXX
  • OS and version: XXX
  • Python version (& distribution if applicable, e.g. Anaconda): anaconda Python 3.7.6 64-bit
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: XXX
  • Relevant/affected Python-related VS Code extensions and their versions: XXX
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info microsoft/vscode-python#3977): XXX
  • Value of the python.languageServer setting: XXX

Expected behaviour

start the python interactive window

Actual behaviour

"Failed to start a session for the Kernel 'Python 3.5.2 64-bit ('root': conda)'. View Jupyter log for further details."
I choose the right version of python:
image
But it doesn't work.
-1585087562783.log

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. XXX

Logs

Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)


Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)


All 14 comments

@denisebid. Thanks for reporting this and providing the log. I just took a look at the log and it was looking like there might be a path mismatch with how we are trying to load Jupyter for the Interactive Window. I know that we've had some issues in this area recently. Could you pick the: "Python: Select interpreter to start Jupyter server" command and select the Anaconda root env. And then try your scenario again?

From the log I see callstacks with both an anaconda path and a default windows path in the callstack. I think setting your interpreter path also to the anaconda path should fix this.

File "C:UsersDeniseAppDataRoamingPythonPython37site-packagestornadogen.py", line 742, in run yielded = self.gen.throw(*exc_info) # type: ignore File "E:UsersDeniseAnaconda3libsite-packagesnotebookservicessessionshandlers.py", line 72, in post type=mtype))

Thanks for your answer.
It doesn't allow me to select the anaconda root env.
image

@denisebid that's a bit odd. Was that env deleted from your system? I would try to recreate a new conda env that has jupyter and whatever else you need in it, and then try to use that as the jupyter interpreter and kernel for your interactive window.

it shouldn't be deleted. I've just installed python (anaconda) and visual
basic code. I could try deleting everything again and installing it again.

El jue., 26 de mar. de 2020 a la(s) 12:21, Ian Huff (
[email protected]) escribió:

@denisebid https://github.com/denisebid that's a bit odd. Was that env
deleted from your system? I would try to recreate a new conda env that has
jupyter and whatever else you need in it, and then try to use that as the
jupyter interpreter and kernel for your interactive window.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/vscode-python/issues/10762#issuecomment-604482882,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AO5ZMS3JG2NPHACCUHDD3WLRJNVLZANCNFSM4LTBSOUA
.

If you consider, I could give you remote access to my computer so you can
check it out.

El jue., 26 de mar. de 2020 a la(s) 12:35, Denise Bidinost (
[email protected]) escribió:

it shouldn't be deleted. I've just installed python (anaconda) and visual
basic code. I could try deleting everything again and installing it again.

El jue., 26 de mar. de 2020 a la(s) 12:21, Ian Huff (
[email protected]) escribió:

@denisebid https://github.com/denisebid that's a bit odd. Was that env
deleted from your system? I would try to recreate a new conda env that has
jupyter and whatever else you need in it, and then try to use that as the
jupyter interpreter and kernel for your interactive window.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/vscode-python/issues/10762#issuecomment-604482882,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AO5ZMS3JG2NPHACCUHDD3WLRJNVLZANCNFSM4LTBSOUA
.

What I would start with now is just creating a new fresh environment for conda from the command line:
https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

Then install jupyter and any needed dependencies into that env. Our interactive window and notebook editor will only work when there is an environment available with Juypter to run in. If you can run "python -m jupyter notebook" from that environment in the anaconda command prompt and that starts up a notebook that should be good to use with VS Code.

I had the same issue after I update the newest version VSCode...Any solution so far???

The problem finally was that I has instaled it and uninstalled it a couple
of times. So, the VSC looks for information in a wrong folder.
Thank you all for your help!

Denise

El dom., 29 de marzo de 2020 23:18, lixin6135 notifications@github.com
escribió:

I had the same issue after I update the newest version VSCode...Any
solution so far???

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/vscode-python/issues/10762#issuecomment-605746824,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AO5ZMS75DPQUEDHBQ57BSD3RJ76PVANCNFSM4LTBSOUA
.

@denisebid Good to hear that it's working now. VSC does do some caching of interpreters between runs (since searching is slow) so that makes sense that an old env was showing up for a bit after an uninstallation. Anaconda can also be tricky to get uninstalled, there are some instructions online about making sure that all the files that it puts down are cleaned up after removal. I've seen that causing issues with VSC as well.

@lixin6135 Can you open up a new issue with your details? Failing to start a session is a pretty general symptom, so it might not be the same thing that denisebid was running into. Would be easier for us to track your issue if it has it's own thread and details.

Ian,

I also have an issue of the same kind. The error is same but here is the problem statement.

Problem Statement:
Failed to start a session for the Kernel 'Python 3.8.0 64-bit ('root': conda)'. View Jupyter log for further details

Solution Attempted:

I had python version 3.8.0 for VSCode and then when trying to start Jupyter had the issue mentioned. Next after going thru the blog changed the Python interpreter path to the conda path which had a 3.7.2 python version but still it failed. On further analysis of the log I see it states the below. What does that mean?. I am using Windows 10 Professional and latest VS Code (Mar 2020 - 1.44.2 version)

ImportError: DLL load failed while importing win32api: The specified module could not be found.

Error Log details below

 return next(self.gen)
  File "c:\users\grajendran\appdata\local\programs\python\python38\lib\site-packages\jupyter_core\paths.py", line 435, in secure_write
    win32_restrict_file_to_user(fname)
  File "c:\users\grajendran\appdata\local\programs\python\python38\lib\site-packages\jupyter_core\paths.py", line 361, in win32_restrict_file_to_user
    import win32api
ImportError: DLL load failed while importing win32api: The specified module could not be found.

[W 23:01:37.892 NotebookApp] Unhandled error
[E 23:01:37.897 NotebookApp] {
"Content-Type": "application/json",
"Authorization": "token 57ced57a3b7917ca1408a6c53f5d5c276735a5cbfdf00f94",
"Accept": "/",
"Content-Length": "158",
"User-Agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
"Accept-Encoding": "gzip,deflate",
"Connection": "close",
"Host": "localhost:8889"
}
[E 23:01:37.898 NotebookApp] 500 POST /api/sessions?1587189697780 (127.0.0.1) 65.00ms referer=None

Have an update to my earlier comment. I had now uninstalled the Anaconda version and also the Python . Freshly downloaded both and installed VS Code thru Anaconda and after setting the Python interpreter it worked FINALLY!!!.

Its so awesome now to have Jupyter notebook in VS Code

@gunasekarr Glad to hear that. Configuration and installation can still be a tricky point with Jupyter. So we're doing some work in this area that should hopefully help folks out in the future with initial. Since I believe from this thread that @denisebid and @gunasekarr are both up and running I'm going to close this issue.

Thanks a lot Ian for your help much appreciated

Was this page helpful?
0 / 5 - 0 ratings