Lampros Chantzis
Lampros Chantzis

Reputation: 15

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?

Upvotes: 1

Views: 10681

Answers (3)

Ani
Ani

Reputation: 441

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.

Upvotes: 0

Steven-MSFT
Steven-MSFT

Reputation: 8411

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

enter image description here

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

enter image description here

And you can switch the kernels:

enter image description here

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

enter image description here

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

Upvotes: 3

Grzegorz Bokota
Grzegorz Bokota

Reputation: 1804

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.

enter image description here

Upvotes: 3

Related Questions