简体   繁体   中英

Can I use Jupyter notebooks in vs code without installing anaconda?

In almost every tutorial that I have seen, it is suggested to install anaconda in order to work with jupyter notebooks in Visual Studio Code, but I don't want all the packages that anaconda offers. Is there any other way to do this?

Yes. Jupyter does not need to have anaconda installed. You could install it in any python environment with pip install jupyter[all] .

I do not know how to change the default jupyter environment, but you could start Jupiter notebook from the terminal (using jupyter notebook command) and then copy the link and use it as an exiting server.

在此处输入图像描述

Have you installed the Python extension, it is bound with Jupyter and Pylance extensions.

在此处输入图像描述

And you can create the jupyter notebook with the command of Jupyter: Create New Jupyter Notebook :

在此处输入图像描述

And you can switch the kernels:

在此处输入图像描述

After you selected the python interpreter in the Jupyter Notebook, if this environment has not installed the related packages, it will prompt this:

在此处输入图像描述

You only need to click install, then the Jupyter extension will help you to install all the packages.

I was facing a problem with no run option showing in notebook inside VSCODE. I followed below steps:

-installed python (i got 3.9) -installed Jupyter Notebook from pip

pip install notebook

-open VSCODE, install python extension (it comes with jupyter and pylance)

-in VSCODE, ctrl+shift+p > python:select interpreter (I was having problem here with error 'No interpreter found'. I solved it by ctrl+shift+p > preferences: Open Settings (JSON) and putting "python.defaultInterpreterPath": "C:\Python39\python.exe")

-then installing ipykernel

pip install ipykernel --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org

-then I had to create.ipynb file manually in VSCODE by creating an new file and saving it in format.ipynb

Voila.! jupyter notebook is running.

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