简体   繁体   中英

Select python kernel for Jupyter notebook

This is a basic beginner question.

I have a python Jupyter notebook, when <Enter><Shift> is used, the focus goes to the top of the screen where the message is Select kernel for 'D:/...' Under this is the message: "Install kernels from the marketplace." There is no other visible message to explain what that means or what I am missing.

Steps to solve.

In one document, it mentioned that VSC should be opened using code from a [conda] environment where python is installed and there is a kernel. This required the following code in my environment

activate conda environment edw

conda activate edw

Next install a kernel

 ipython kernel install --name "edw" --user

Verify the kernels

jupyter kernelspec list

result

 edw              C:\Users\hnelson3\AppData\Roaming\jupyter\kernels\edw

Start VSC

code

Next I open a notebook and put my cursor in a code block.

<Enter><Shift>

The message Select kernel for 'D:/...' appears. What is the next step?

Thanks.

在此处输入图像描述

在此处输入图像描述

I had that message 'Select kernel for 'D:/...' appearing as well when I first tried to run a jupyter notebook in VS code. Turns out I had to install and enable the jupyter extension ( https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter ) and the python extension ( https://marketplace.visualstudio.com/items?itemName=ms-python.python ) as according to these instructions from https://code.visualstudio.com/learn/educators/notebooks :

"You will need to have Python 3 installed on your machine along with the Microsoft Python extension installed from the VS Code Marketplace...

In addition, you need to install the Jupyter Notebooks extension...

Once you have Python and the extensions installed, you will need to activate the Python environment by using the command Python: Select Interpreter from the Command Palette (Ctrl+Shift+P)."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM