How To Setup & Run Jupyter Notebooks in VSCode | Jupyter Notebooks in Visual Studio Code (2024)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys in this video I'm going to show you how you can set up the Jupiter notebook with your Visual Studio code on your Mac operating system so let's get started and let's see how we can do it so first of all you need to install anaconda on your Mac operating system so let's see how we can install Anaconda so first of all open your favorite browser and search for Anaconda and the first link which will appear here will be from anaconda.com so we are going to click on this link so on this main page you can read more about Anaconda distribution for downloading Anaconda click on this free download link here which is going to redirect you to the anaconda.com downloads URL here you will be able to see the download button for Mac OS now here when you click on this uh arrow drop- down menu you have two options for the Anaconda distribution if you using Macos with the in Intel processor then you can use the first option if you are using Mac OS with apple silicon chip like M1 M2 or M3 you can click on the second option which is download for Mac M1 M2 M3 I have M2 Chip on my Mac OS so I'm going to select the second option here which is download for Mac M1 M2 M3 which is going to start the download of this PKG file it's around 742 megabyte file so it'll take some time to download so just wait for the download to complete so once this uh Anaconda do PKG file is downloaded I'm going to click on this PKG file and let me minimize the browser now this is the first window which will appear when you try to open this PKG file which is going to show you this kind of warning which says this package will run program to determine if the software can be installed I'm going to click on allow here which is going to to start the Anaconda installer at this point you have this introduction section so I'm going to click on the continue button on the next window you will see some important information about Anaconda so you can read this uh information and uh once you are done click on continue the next window will show the software license uh agreement window so you can read about this software license and then click on continue and then if you agree with the license terms and conditions click on agree which is going to show you the installation type now here it says this will take around 4.81 GB of space on my computer I'm okay with this so I'm going to click on install button which is going to start the installation of anaconda now at this point I just need to wait for some time until uh this uh installation is finished and now I can see after a few seconds the installation was successful and you can see the Anaconda launcher is being launched and then you will see uh these kind of Windows now when uh Anaconda starts for the first time it's going to show you this kind of anaconda Navigator and if uh this Anaconda recognizes that you have some older version of Anaconda it's going to uh encourage you to update your aond so here you can see do you wish to update to the newest version for now I don't want to do it but you can press on yes and then install the latest version of Anaconda I'm going to click on remind me later so I can do it later also so this is how uh this Anaconda Navigator looks like and at this point I can also click on continue here and it says code with the anaconda in Cloud I will click on continue and and then I'm going to click on close which is going to uh finish the installation of anaconda so we don't need this PKG uh installer anymore so we can click on move to bin which is going to move the installer to the bin now once you have Anaconda installed you need to open the terminal and then run this command to activate the required kernel for the jupyter notebook and the command is cond install ipy kernel and then press enter which is going to start the installation of this package and in the process of installation it's going to ask you to proceed and just press y here and then press enter which is going to finish the installation of this ipy kernel once this ipy kernal package is installed via cond we are ready to get started with Jupiter node notebook with our Visual Studio code editor so let me close this terminal and open the vs code and once the vs code opens you need to go to the extensions section here and then search for Python and if you haven't already installed this python extension just install this so this is the first result which will appear when you search for python here and you can see it has been downloaded around 107 million times so it's a official extension from Microsoft for python on Visual Studio code so I'm going to click on install here which is going to install this extension once this extension is installed you can see uh this disable button and uninstalled button here this extension also includes the support for Jupiter notebook and that's why we have installed this extension so once this python extension is installed we need to install one more extension for Jupiter notebook and that is called Jupiter okay so search for Jupiter here and then click on Jupiter and this extension is also from Microsoft I'm going to click on install here and it's going to also install the Jupiter notebook and once the installation is finished you will be able to see the disable or uninstall button here so install python extension and the Jupiter extension once these two extensions are installed we are going to go to the Explorer and then let's open a new folder here so let me open my documents folder and and here I have this notebooks folder in which I'm going to create my Jupiter notebooks so I'm going to click on ADD which is going to add this folder in my visual studio code so let me close this window so now inside this folder we are going to create a new Jupiter notebook file so I'm going to name my file as test do ipynb which is the extension for jupyter Notebook and then press enter and visual studio code is going to recognize that we are trying to create the Jupiter notebook so it's going to create this kind of interface which is similar to Jupiter Notebook on the browser also it's going to show you this kind of notification which says we noticed you are using using cond environment if you are experiencing issue with the environment in the integrated terminal we recommend that python extension should be installed this one right so so for now I'm going to just collapse this notification and here in this test. iynb uh file you can see I can add a markdown or the code cell using these options but first of all I need to select the kernel so just click on this select kernel option and then you will be able to see the existing uh Jupiter server here or you will also see the python environments here okay so I'm going to click on python environments and then I'm going to select the Anaconda environment whatever option says Anaconda just select that option and then you can see the base uh Python 3 . 11.5 is selected here okay so once that's selected Let's uh first start with the markdown so I'm going to change this uh cell type to markdown and then I'm going to add some headings so for example my first notebook here and then I'm going to click on this run button which is going to execute this cell and you can see the output here now in order to add the new cell you can click on this uh Plus Code so it's going to add the code cell if you want to add a markdown it's going to add a markdown cell so let me click on plus button here and then let's uh just uh evaluate some python code so for example 5 + 5 now in this case I'm going to press uh this option which says execute cell and below and it's going to just print me the output which is 10 which is correct right so in this way you can keep on adding the code cell or markdown cell or any other cell so let me once again add the code cell here and you can even change the type of cell so you can add the python markdown batch HTML so all these options are available for the cell here right let me print something for example so I'm going to just uh type print and then I'm going to just print hello world and this time I'm going to click on this button which says run by line and it's going to open this kind of debug console here right so if you want to uh open the debug console then it's going to open this kind of debug console here and then I can move or continue the execution from here okay you can also open the terminal or the Jupiter option here and you will be able to see the variable values if you have declared some variables and then and move forward to the next line for example if the variable have some value you will be able to see the values there also you can just come out of this uh debug by just pressing on this stop cell execution button and then it says keyboard Interruption so we have uh just stopped this so it's showing us the keyboard Interruption option I can also delete the cell by clicking on this delete cell button which is going to delete the cell right so this is how you can add the support for Jupiter notebook in your Visual Studio code editor I hope You' enjoyed this video and I will see you in the next video
Info
Channel: ProgrammingKnowledge
Views: 5,476
Rating: undefined out of 5
Keywords: Can you run Jupyter notebooks in VS Code?, How do I open Ipynb in VS Code?, How do I run a Jupyter Notebook in code?, How do I install Jupyter in VS Code?, How to setup Jupyter Notebook in Python?, How do I run Ipynb files?, How can you execute Python code in Visual Studio Code?, How do I access Python shell in VS Code?, How to use sklearn in VS Code?, How to connect Jupyter with Visual Studio?, Does VS Code support notebooks?, How do I connect Jupyter lab to VS Code?
Id: K0B2P1Zpdqs
Channel Id: undefined
Length: 11min 8sec (668 seconds)
Published: Fri Feb 02 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.