Install NumPy with VSCode - Windows

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone in this video we are going to see how to set up numpy with vs code now if you do not have python or vs code installed then you should proceed with this section otherwise you can go to the next section where we will be proceeding with setting up numpy with vs code directly and if you don't have python installed simply go to this link and click on download python 3.11.2 whatever is the current version you can download that click on this exe and it will start the process So currently I have python installed that is why it says modify or repair but in your screen you should see an install option and at the bottom you'll have a check box you should click on that check box and then click on install and python will be installed in your windows after python is installed you can go ahead and download vs code for Windows as well simply click on this link and once the exe file is installed you can double click on it and simply proceed with next next options and you will have vs code installed on your system now if you want to see a detailed video of how to set up python with vs code for a Windows I have created a video for that as well and you can find link for that video in the description now let's open our vs code and in vs code if you see I already have this test.py file where I'm trying to import numpy and then trying to Simply print with a numpy function and you can see that I'm getting an error because numpy is not found that package is not resolved yet how do we fix it over here on top you can see this toggle panel so if you click on it this will open your terminal so there are two ways to Simply fix this issue the first way is to Simply write this command pip install numpy and this will install numpy and fix the issue which we are seeing in our code as you can see it is installing numpy package let's wait for some time and once numpy is installed you can see my error is gone and I can go and simply click on this button to run our code if you don't know how to get this button I have installed our extension python extension that is why I'm getting that run button to run my python code if you do not have this button you have to go to extension and install this python extension once that is installed you should be able to see this run python file button and when you click on it you will be able to see the result of this test.poi file so as you can see it is printing a metrics with our numpy now this is one way to do it but this is not the recommended way because if you're creating multiple python projects you might have to install different version of the packages like a different version of numpy a different version of other packages you might need so it is recommended to create a virtual environment to run all these packages so instead of installing numpy for all your projects in your system you will be installing numpy only for this particular project by creating a virtual environment so how can we do that let's first uninstall numpy so to uninstall numpy we have SIMPLE command VIP uninstall numpy and numpy is uninstalled and now we got our error back now how do we fix it with virtual environment first let's create our environment so to create a virtual environment we have a command saying py minus m v e n v which is virtual environment and then the name of the environment so I would just simply say environment itself and click enter and it will create a virtual moment in your project itself so over here if you see this has created a new folder and then you will get this pop-up as well we notice new environment has been created do you want to select it for workspace folder so you you have to say yes for it now as soon as you said yes you will see over here our workspace folder has been changed and if you click on it this is the selected one we have the virtual environment exe selected not the old one now once virtual environment is created we have to activate this virtual environment and if you go inside this folder we have this script folder and inside the script folder we have this activate so to activate virtual environment all you have to do is run this so simply say EnV forward slash script forward slash activate now if you see in green color you have your virtual environment written over here the name of your virtual environment is over here it means now whatever command you will run it will run in the virtual environment so now in this virtual environment we can install our numpy so the command would be same as we did for our local so it would be pip install numpy and click enter and now it will install numpy in our virtual environment and it would only be applicable for this particular project this test b y so as you can see once our numpy is installed in our virtual environment the error to import our numpy is gone now and now we can go ahead and run this file and as you can see we have got our result as well so this is how you can install numpy in your local machine or in Virtual environment for your project if you like this video please do like subscribe and share it with your friends thank you so much for watching bye
Info
Channel: Harsivo Edu
Views: 30,482
Rating: undefined out of 5
Keywords: setup python for vscode, python, python tutorial, how to install python on windows 10, python for vscode, vscode, python vscode setup, python vscode setup windows, python installation in windows 10, vscode in windows 10, Install python, install python libraries in visual studio code, pip, pip python install, pip python tutorial, pip python, pip python vscode, numpy, numpy python, numpy tutorial, numpy vscode, install numpy vscode windows, numpy vscode install
Id: 1ivFkpOuPw4
Channel Id: undefined
Length: 5min 24sec (324 seconds)
Published: Wed Apr 05 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.