Это видео недоступно.
Сожалеем об этом.

How to install Python Libraries in Visual Studio Code

Поделиться
HTML-код
  • Опубликовано: 14 авг 2024
  • This video is a quick tutorial on how to import Python Libraries when using Visual Studio Code.
    I had been trying to figure this out for myself but could not find good tutorials on the internet so thought I should make one. For the purpose of this video, we'll use matplotlib in python as an example.
    Timestamps:
    0:00 Introduction
    0:25 Create and open a New Folder
    0:59 Problem Description (matplotlib as an example)
    1:33 Create a Virtual Environment in Python Project
    2:18 Resolving the import issue (pip install)
    2:48 Run the program
    2:57 Conclusion
    ----------------------------------------------------------------------------
    Hey!
    I am Aditya Thakur, a Developer and Designer. I make videos on Flutter, Python, and other technologies. I also sometimes take up Profile Building and entrepreneurship!
    💙 Learn how to use Flutter with Firebase: • FlutterFire - Free Fir...
    🎬 Python Debugged Playlist: • Python Debugged
    📚 PROMOS
    Get an exclusive 10% discount on every GeeksforGeeks course!!
    Use code: ADITYAT
    Check out courses here: practice.geeks...
    💰 INVESTMENT APPS
    Create a free account | Binance: accounts.binan...
    Trade at India’s largest exchange | WazirX: wazirx.com/inv...
    I post stories about my life and business on my Instagram - / adityathakurxd
    Want to talk business? Or ask a question?
    Reach out to me on LinkedIn: / adityathakurxd
    ----------------------------------------------------------------------------
    Become a part of my community! (100+ Developers already 🥰)
    Link to Discord/Telegram: linktr.ee/flut...
    Thank you for watching!
    Hope this video helped you.
    Leave a comment and do Subscribe the channel. Cheers!

Комментарии • 574

  • @robertruta687
    @robertruta687 3 года назад +601

    For those missing green (venv). Solution:
    after you have typed the command "python -m venv ..." and have hit enter as my man Aditya does at 2:05 and have waited for it to make the venv directory, type into the terminal the following line:
    venv\scripts\activate
    and hit enter. Done. You should now how the green (venv) and be working with your virtual environment.
    !!ERROR!!
    If an error pops up about permissions or access being denied or something, go ahead and type into the terminal (you might want to reverse this change after you have done it btw, so read about this if you concerned):
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
    and try executing "venv\scripts\activate" in the terminal again.
    !!ADDITIONAL POSSIBLE FIXES!!
    - make sure you're terminal is working in the correct directory (for example: C:\Users\Asus\Desktop\Project>) before executing "venv\scripts\activate"

    • @tanushsavadi988
      @tanushsavadi988 3 года назад +12

      Hey bro, thank you! May I know what 'Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process' does, please? Also, do you know how to revert back, please? Thank you :)

    • @robertruta687
      @robertruta687 3 года назад +19

      @@tanushsavadi988 I can’t give you a high level answer to this question, however, I can tell you for sure that it grants you permission to execute scripts. The -scope process makes it so that this permission is returned to its default value as soon as you’re done with whatever you’re currently doing. If you want to permanently grant yourself permission to execute these scripts, you just have to remove the “-scope process” part.
      In summary, you can using that command without worrying because all is returned to its original state after you’ve used venv\scripts\activate ;)

    • @tanushsavadi988
      @tanushsavadi988 3 года назад +6

      @@robertruta687 Cheers mate, thank you. I get the gist of it now

    • @bikikumarsahkalwar8477
      @bikikumarsahkalwar8477 3 года назад +2

      Thanks a lot!

    • @Jacob11227
      @Jacob11227 3 года назад +15

      hey for some reason after i installed the library i want the venv folder is still there unlike Aditya's and ist sayin there is no module called that

  • @jeff3608
    @jeff3608 3 года назад +49

    Thank you so much! I have been searching for an easy to follow explanation like this for so long!

    • @AdityaThakurXD
      @AdityaThakurXD  3 года назад +3

      Thank you :) I am glad.

    • @YashvirGaming
      @YashvirGaming 3 года назад +1

      @@AdityaThakurXD help me fix this
      import requests could not be resolved from source vscode

  • @marceloquesada8304
    @marceloquesada8304 3 года назад +44

    Thanks so much, i´ve been trying to solve this for ages and your tutorial was the first that i found that was intuitive and easy to follow, keep up the good work!

  • @itsarshadahmad
    @itsarshadahmad 2 года назад +47

    To create virtual environment:
    -> py -m venv env
    To activate virtual environment:
    -> .\env\Scripts\activate
    To deactivate virtual environment:
    -> deactivate

    • @MrMenace3210
      @MrMenace3210 2 года назад +5

      you haven't even got the same syntax/arrangement as the video or the top example, yet your is the only one that works for me. Very grateful!

    • @kyberghost3607
      @kyberghost3607 5 месяцев назад

      @@MrMenace3210 Same here

  • @durb5259
    @durb5259 3 года назад +11

    I litterly searched this up because i needed to make a graph in python for school and u actually just did it with a graph xD

  • @noiiz666
    @noiiz666 2 года назад +3

    man, this is perhaps the best (the shortest and brief) video to solve the problem. thank you very much

  • @johnreskusich2324
    @johnreskusich2324 2 года назад +8

    Your explanation is awesome. Been trying to figure it out for hours and I saw your video and it fixed everything. Much appreciated. Thank you

  • @Long_Dong_Chong
    @Long_Dong_Chong 3 года назад +22

    Thank you for a well produced straightforward tutorial. Learned what I needed to without all the bs. 👍

  • @RAWRCoding
    @RAWRCoding Год назад +34

    If VS Code is still throwing an error about the library import, make sure you select the correct interpreter (CTRL+SHIFT+P) and type "Interpreter" and choose the correct one.

    • @totsh2056
      @totsh2056 Год назад +2

      Thank you so much. I struggled with this all day.

    • @gianlucaalfieri3607
      @gianlucaalfieri3607 Год назад +1

      You should be the second comment in the list tysm

    • @meekykols2917
      @meekykols2917 Год назад +1

      Please what's the correct interpreter

    • @casagrande__2526
      @casagrande__2526 Год назад

      you sir are the goat

    • @rajatdang8973
      @rajatdang8973 Год назад

      I am trying to do so but nothing is changing

  • @huynna664
    @huynna664 2 года назад +1

    thanks a lot, I spent nearly a week and tried many ways but nothing actually happened until I followed your instructions. Many thanks!!!!!!!!!

  • @chrisjones469
    @chrisjones469 3 года назад +5

    Thank you for this! I was following a Python tutorial, but I didn't want to use a new editor. I was having issues using Python modules until watching this.

  • @patrickkutal7166
    @patrickkutal7166 Год назад +2

    Thanks man, I have been trying to find the solution almost all day but this one thing cracked it for me finally! :)

  • @mohd.irfanlohar4544
    @mohd.irfanlohar4544 3 года назад +4

    Thanks Bhaiya i have a question can we run pandas by this method
    By writing pip install pandas

  • @juhasimpson5412
    @juhasimpson5412 6 месяцев назад

    I can't believe I need this vedio even after I have been a senior student.

  • @brandonuriel5636
    @brandonuriel5636 26 дней назад

    Thank you, brother. I couldn't solve this same problem but with Numpy. The bookcase was underlined in yellow and I couldn't execute my arrangement. Now with your steps I managed to execute my script. Thank you!!

  • @hydrochloricgamer4521
    @hydrochloricgamer4521 Год назад +2

    If python --version does not work use py --version in cmd
    also use py instead of python in vscode

    • @karimgnz5270
      @karimgnz5270 Год назад

      thanks bro, I was having this problem

  • @travissherman9979
    @travissherman9979 3 года назад +8

    hey , mine doesnt show the green venv but I'm not sure. any help?

    • @shreyamkumar7210
      @shreyamkumar7210 3 года назад +1

      my also its not showing but everything is working fine on pc

    • @drissou76
      @drissou76 2 года назад

      bro same issue idk what to do

  • @alexandrespiri4297
    @alexandrespiri4297 2 года назад

    Been stuck for ages ! Thanks so much. This shit about installing libraries takes 90% of my "coding" time.

  • @fakebuddy5390
    @fakebuddy5390 2 года назад +1

    bro huge thx
    its 5 pm
    i was trying to execute my project from morning itself but again n again m getting same error ,, but after watching this tutorial i got to know virtual environment is must thing
    thx buddy again
    (i m new to python )

  • @user-qc1ex7hh2c
    @user-qc1ex7hh2c Год назад

    Thanks sir it’s the eisiest way you can display your graphs keep going sir

  • @raianmr2843
    @raianmr2843 2 года назад +30

    You don't have to spell out the entire path of the venv folder. You can just type ".venv". This works because '.' is macro for current working directory's absolute path. So, the command should be "python -m venv .venv".
    Another tip: if you're on Windows and you’ve used the official python installer, there should be a py.exe in your system path. You can use py the same way you use the python exe, it's purpose is to automatically select the most up to date python installed on your system. This isn’t relevant to the video as much but I thought this was something everyone should know.

    • @frydoichmarwienanta4760
      @frydoichmarwienanta4760 2 года назад +2

      tq i got acces denied so many times until use the venv .venv haha

    • @froopi2
      @froopi2 2 года назад

      @@frydoichmarwienanta4760 same

    • @mw7185
      @mw7185 Год назад

      What do you mean by system path ?

    • @deephalder5763
      @deephalder5763 11 месяцев назад

      Thanks bro...

  • @willykitheka7618
    @willykitheka7618 Год назад

    Imagine I had to come back here again. Thanks Thakur!

  • @junaid_qadir
    @junaid_qadir 2 года назад +5

    Hi thanks for the short video clip. I created virtual environment with your method, but it cannot activate like a green color on your screen (venv). Can you please let me know how can I activate it?

    • @priyadarshnisundararajan5774
      @priyadarshnisundararajan5774 5 месяцев назад

      Same problem!What to do?Did u find a solution?

    • @srivenkateshakula2048
      @srivenkateshakula2048 2 месяца назад

      I think you have to create a new terminal and paste the powershell file path (Activaet.ps1), then press enter.

  • @digitizzein1462
    @digitizzein1462 3 года назад +3

    Hey Aditya, Hope you are doing good. I am getting permission denied error while using pip in vs code. Can you help me ? Would be great help.
    Thanks

  • @juansteiven2441
    @juansteiven2441 3 года назад +3

    Does this method also work when we want to use Numpy and Pandas?

  • @pumkinkidd1165
    @pumkinkidd1165 2 года назад

    bro you dont know how much u just saved me, ive been using vms and was gonna get a laptop cause my pc was being weird, this saved me tysm

  • @FriedPawnsForDinner
    @FriedPawnsForDinner 2 года назад

    Omg thankyou so much I cant believe I was trying to import using the terminal rather than the code space👀

  • @troychalmers3646
    @troychalmers3646 2 года назад +1

    thank you very much, it worked first time for me. I remember needing to do this in the spyder IDE but either it was easier or I had a teacher holding my hand the whole way

  • @alnoorratansi9364
    @alnoorratansi9364 3 года назад +7

    Great video, I am not getting the green (venv) can you help please, thanks

  • @abhisheksaini7973
    @abhisheksaini7973 2 года назад +5

    If you are still having errors after performing everything then , actually python 3.9 and 3.10 might have some issue installing libraries, so try installing an older version like 3.8

    • @georgemanuelajan8263
      @georgemanuelajan8263 2 года назад

      hey i think i have this problem because after doing all like the video python still say me that he don't find matplotlib, so how can i install an older version please ?

    • @roshanleanage1275
      @roshanleanage1275 2 года назад

      You are spot on !!! I had this problem with installing pandas in 3.9. Once I went back to a older version everything was working....

    • @synaxreader9326
      @synaxreader9326 2 года назад

      @@roshanleanage1275 Which version did you go back to?

  • @rosspatel3526
    @rosspatel3526 Год назад

    this worked! Be sure to have powershell as your terminal type.

  • @Userisnmuh
    @Userisnmuh 2 года назад

    thank you so much, I browsing for hours until I found your tutorials,,,very simple to solve the problem

  • @sopino155
    @sopino155 8 месяцев назад +1

    Hi Aditya, thank you for the tutorial. When I follow your instruction and try to create ve, console says that my command not found. I just started using VS and probably I am missing some extensions?

  • @mohammedarmankhan2152
    @mohammedarmankhan2152 Год назад

    Take love brother from Bangladesh. This vedio is very helpful for me.And easily solved my problem.I think you create more vedio.Thank you.💓

  • @GreenSpeedPRO
    @GreenSpeedPRO 2 года назад

    I don't have slightest idea about coding but you fixed my problem.

  • @kidtoucher302
    @kidtoucher302 2 года назад

    WOW THIS INDIAN FRIEND SAVED MY LIFE!

  • @carlospincheira532
    @carlospincheira532 3 года назад

    I been stuck like almost 3 week until I saw this video, THANKS YOU!!!!!

  • @earlsandersjr.2023
    @earlsandersjr.2023 2 года назад

    Thank you, I been trying to do this for 2 days . Watching your video I finally figure it out..Thanks

  • @nithyalakshmigurupackiam2186
    @nithyalakshmigurupackiam2186 2 года назад +1

    Thank you so much for your video sir.I was looking for this for hours.Finally I got it

  • @luvlegendgaming5912
    @luvlegendgaming5912 Год назад +3

    Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
    bro i am facing this error . can someone assist me on how to fix it?

  • @user-wk3oj4zd1u
    @user-wk3oj4zd1u 9 месяцев назад

    Thank you. Very short and to the point and It works.

  • @mingji753
    @mingji753 2 года назад

    very thank you sir, i had trouble running pygame code. I fixed it now. thanks. Keep making these type of videos.

  • @arthgupta614
    @arthgupta614 3 года назад +11

    Getting error of excess denied

    • @GoonvGoon
      @GoonvGoon 2 года назад +3

      Run the actual power shell as an administrator then enter : Set-ExecutionPolicy RemoteSigned
      Then click Yes

  • @yasminadjebbara7793
    @yasminadjebbara7793 2 года назад

    THNXXXX I HAD THE ERROR AND CORRECTED IT FOLLOWING THE STEPS IN YOUR FIRST COMMENT ^^

  • @hitanshujena7470
    @hitanshujena7470 4 месяца назад

    thanks bhai 😁i am watching this in 2024 and still it is very helpful for me

  • @rafikamara1274
    @rafikamara1274 Год назад

    God bless you and thank you for everything, fellow knowledge seeker 👋

  • @delphi5373
    @delphi5373 Год назад

    bro, this save my life, thanks

  • @Kaylumm
    @Kaylumm 2 года назад +1

    it just says "no module named venv" whenever I try. can someone help me with this please

  • @dishakumbhar3657
    @dishakumbhar3657 3 года назад

    HATSS OFF I WAS SEARCHING FROM WHEN LIKE SUPER QUICKLY !!!THANKYOU U MADE ME EASY

  • @mikdarmohammed6512
    @mikdarmohammed6512 11 месяцев назад

    Thank you so much. It took me a day to get results from you

  • @rishupranjal
    @rishupranjal 3 года назад +3

    Brother it will really prove to be helpful for me... Thanks for sharing❤

    • @AdityaThakurXD
      @AdityaThakurXD  3 года назад +1

      I am glad ✨ Thank you for leaving a comment. 💯

  • @kumarabhilasha4
    @kumarabhilasha4 Год назад

    Okaya this was my 6th video and finally I could do it.. Thanks

  • @nehakathuria89
    @nehakathuria89 2 месяца назад

    Thnq sir for this fruitful video

  • @dineshkanakaraj956
    @dineshkanakaraj956 3 года назад +3

    bro u r really awesome, i was trying to import cx_Oracle in vs code for the past two days i tried every possible way. Im fraustraded to the core while watching ur video, but after it was not the same it is working. Thanks lot. go great heights.

  • @PrankIncluded
    @PrankIncluded 2 года назад +1

    Thank you so much sir ❤️

  • @user-kc1gp5mo7k
    @user-kc1gp5mo7k 8 месяцев назад

    Thank you very much. Your video was very helpful

  • @user-sq4tt4tn7e
    @user-sq4tt4tn7e 8 месяцев назад

    finally some one with this wallpaper!

  • @Magma-uw7yo
    @Magma-uw7yo 3 года назад +1

    I've got an error when I try to install the venv, it's say : Python was not found. I'ld like to install pandas, numpy etc but I can't find a solution. Thank you

  • @enderalex300
    @enderalex300 4 месяца назад

    good video, you did good with this one.

  • @Sbie753
    @Sbie753 10 месяцев назад

    Thank you for the tutorial very simple to understand. However I have a question, do we do this for all of our projects or is there a way you can store the modules once so that you can use them again?

  • @raghavanand27
    @raghavanand27 3 года назад +2

    Aree sir ji big fan... Great Video 🔥

  • @bksl
    @bksl 11 месяцев назад

    Thank you so much For your better explanation.

  • @makeitrain113
    @makeitrain113 2 года назад +1

    this tutorial was what i was looking for thank you !!

  • @professormhassan6703
    @professormhassan6703 5 месяцев назад

    Thank you for this, really helpful. Wanted to ask about anaconda along with vs code; thought downloading anaconda brings all the libraries and no need for individual pip installs. First is that true? If yes how to get anaconda support in vs code? Of not, is there a shorter way to get all or most libraries in one go instead of one by one pip install into the venv?

  • @nabink9956
    @nabink9956 2 года назад

    Great video! It really worked out for me. Thanks for making very short and sweet

  • @rignitegroup
    @rignitegroup Год назад

    I recommend your videos. so helpful

  • @killuakillua8876
    @killuakillua8876 Год назад

    thank you soo much , it really solved my problem ,

  • @sasipanakal4458
    @sasipanakal4458 11 месяцев назад

    Thank you Aditya for the video🙏

  • @therzook
    @therzook 3 года назад

    I tried to do venv several times... finally got it thank you. sometimes we all hit roadblock which is like a fart in a spacesuit, life

  • @galactus4829
    @galactus4829 Год назад

    thank you so much bro this helped me a lot. love the way you make understand. thanks a lot 😀

  • @pointblank3409
    @pointblank3409 Год назад

    gr8 vid bro, thanks for making

  • @The_Dark_Phoenix_GD
    @The_Dark_Phoenix_GD 10 месяцев назад

    Thank you finally I can install pywhatkit tq.....😊😊

  • @sankettank6193
    @sankettank6193 Год назад

    INFORMATIVE VIDEO BTW THANKS A LOT!!!
    I GOT INSTALLED PANDAS

  • @deepalijoshi3203
    @deepalijoshi3203 2 года назад

    Thanks Aditya...This video is really helpful.

  • @anandar3953
    @anandar3953 3 года назад

    Simple and clean no messy things thanks bro

  • @kailashpoongundran970
    @kailashpoongundran970 Год назад

    nice job man i really need those vids
    hats off to you
    👌👌👌👌

  • @Ctk24
    @Ctk24 9 месяцев назад

    Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Sir What i Do?

  • @swastikaggarwal221
    @swastikaggarwal221 Год назад

    really a helpful , thanks for sharing ,,,

  • @danielhornsby1100
    @danielhornsby1100 3 года назад +1

    Yess thank you! exactly what I was looking for!

  • @hydrochloricgamer4521
    @hydrochloricgamer4521 Год назад

    If you encounter could not be loaded because using script is disable the nuse following command in windows power shell
    Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser

  • @user-os3sv8tt2w
    @user-os3sv8tt2w 3 года назад +2

    thank you so much! very helpful!

  • @neelamthakur72
    @neelamthakur72 3 года назад +2

    Great job... 👏

  • @migueljimenez9060
    @migueljimenez9060 3 года назад +1

    Ey men I fix it, thanks for this video!!!

  • @ayushbhardawaj9506
    @ayushbhardawaj9506 2 года назад

    Thanks sir for Your help I was really worried for a moment their

  • @superhumano-ai
    @superhumano-ai Год назад

    Worked perfectly! Thanks.

  • @rayantalwar8315
    @rayantalwar8315 Месяц назад

    Hi great video. Can we do the exact same thing but install forecasting packages like pmdarima , prophet etc instead of matplotlib?

  • @jonasschaeferjunior7274
    @jonasschaeferjunior7274 3 года назад +1

    Gzzzzz dude, ty so much, I spend hours trying to solve it with no success

  • @burakt
    @burakt 9 месяцев назад

    You explained it really well. Thanks a lot. So can we do this for the R language as well?

  • @academic_courses
    @academic_courses Год назад

    I would thank you so much, it helped me a lot.. Thanks bro.

  • @mohamedhilowleahmed8265
    @mohamedhilowleahmed8265 7 месяцев назад

    It works thanks brother ❤❤❤

  • @maxkipchumba7604
    @maxkipchumba7604 8 месяцев назад

    Bless up mahn. This was so helpful.

  • @sunilbhardwaj5252
    @sunilbhardwaj5252 3 месяца назад

    Thank you Thakur saab

  • @premthapa9959
    @premthapa9959 2 года назад

    Thanks a lot Aditya , u helped me out a lot

  • @nikitha28
    @nikitha28 Год назад

    Hello, Thank you so much for the content. I was really struggling with installation. This video really helped me out. 😄😄

  • @cloudproblemssolved
    @cloudproblemssolved 5 месяцев назад +1

    that did not work for me, but something else did, i clicked on
    Activate.ps1 under Scripts under Project and ran the entire file and the green (.venv) suddenly appeared
    that did not work for me, but something else did, i clocked on
    Activate.ps1 under Scripts under Project and ran the entire file and the green (.venv) suddenly appeared

  • @robertocianciulli2445
    @robertocianciulli2445 2 года назад

    I've to repeat every time i need those packages this procedure with venv? Or it has to be done just once and i can use such packages. Thank you in advance bro.

  • @rhythmgupta1615
    @rhythmgupta1615 2 года назад

    thank you so much ..keep making such informative videos

  • @User-gu3se
    @User-gu3se Год назад

    When I tried to install a some library using "pip" comand, this message appears in yellow:
    "WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available".
    I'm using windows 10.

  • @321123580
    @321123580 Год назад

    Super helpful, thank a lot)

  • @cayoaponte9450
    @cayoaponte9450 3 года назад +1

    Awesome video man, much appreciated!