How to install Python Libraries in Visual Studio Code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys i'm adit hachor and welcome back to my youtube channel so this video is going to be a quick tutorial on how you can import python libraries when writing code in visual studio i had been trying to figure this out for myself and i could not find any good tutorials on the internet so i thought maybe i should make a video on this so let's get started to begin i'll create a new folder by the name project so i'll open my visual studio code and open this folder we just created inside the visual studio code so go to file and open folder so i saved it on my desktop i'll open it from there once i have my project folder open i'll create a main file so i'll create a python file so it will be main dot py and uh i'll use a simple uh library for this example it's a matplotlib it's a plotting library in python so what i will do is i have written a simple program x and y coordinates and i'll plot and show this so for this i need the matte plot library but you'll notice that there is a yellow line warning line underneath it so that means that even if we have matplotlib inside our system it's not showing up for the visual studio code so therefore head over to your terminal and what we'll do is create a virtual environment so to create a virtual environment we'll go to the terminal and type in python dash mvenv so this is for virtual environment and then we'll copy the path of the project folder so that is very simple you can copy it from the bar and paste it here and then you need to write v env so our virtual environment will be created in a folder called v so it will create the virtual environment when you go back to your project folder you can see our virtual environment there so let's fix this issue now what we need to do is we need to download this matplot library inside our virtual environment so open up the terminal again but this time you'll notice the green v and v before that and your project location so simply type in pip install matplotlib and this should install the matplotlib library inside your virtual environment once this is done click on run and your graph should show up so yeah that's it for the video i hope it helped you if you have a better way do not forget to comment down so that others can benefit from it and thank you for watching
Info
Channel: Aditya Thakur
Views: 974,875
Rating: undefined out of 5
Keywords: python, tutorial, python libraries, pip install, matplotlib, visual studio code, vs code
Id: ThU13tikHQw
Channel Id: undefined
Length: 3min 16sec (196 seconds)
Published: Sun Nov 29 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.