How To Setup A Virtual Environment For Python In Visual Studio Code In 2023

Sdílet
Vložit
  • čas přidán 5. 04. 2023
  • Here's how you can setup a virtual environment in Visual Studio Code for Python.
    ▶ Become job-ready with Python:
    www.indently.io
    ▶ Follow me on Instagram:
    / indentlyreels

Komentáře • 171

  • @rolandonunez1893
    @rolandonunez1893 Před 4 měsíci +64

    For those that didn't get the venv after restarting the terminal and had an error regarding to Execution Policies, just run in the terminal the following script:
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
    and then:
    .\.venv\Scripts\activate (for Windows)

  • @kiyingipisgah4365
    @kiyingipisgah4365 Před 11 měsíci +54

    It has taken me hours to import modules in python but after following this, I can firmly say that I have landed. Btw am a self taught programmer/coder and this was really helpful.😊

  • @NewParadigmAI-zm9lj
    @NewParadigmAI-zm9lj Před 7 měsíci +18

    This is the best damned instructional ever. Honestly, so many 20 minute videos, and this dude knocks it out of the park.

    • @zeebeat123
      @zeebeat123 Před 25 dny

      Couldn't agree more. I have watched SO many videos and they are much longer, and many leave out small but essential details

  • @abubakr9796
    @abubakr9796 Před rokem +7

    Love your videos bro! Easy and simple to understand tutorials and explanations.

  • @kenbajema
    @kenbajema Před 6 měsíci

    Now the dozens of videos I've watched regarding installing Autogen and memgpt etc make sense!! thank you. I've been using conda environments and have had a difficult time finding the and editing the correct .py files! for packages and running them.

  • @abdullahattia2491
    @abdullahattia2491 Před rokem +4

    simple enough and straight to the point
    thanks!

  • @throbicon
    @throbicon Před 10 měsíci

    Thank you so much Indently! This is the easiest way to make a virtual environment. Please continue to make videos; they are valuable!

  • @JamesRBentley
    @JamesRBentley Před 11 měsíci +1

    bro this is the best tutorial on how to do this, clear, simple, perfectly illustrated for beginners

  • @amigobrewbrew9297
    @amigobrewbrew9297 Před 11 měsíci +1

    As a beginner I was lost but now it all makes sense. Thanks!

  • @boitedamour
    @boitedamour Před 3 měsíci +1

    after 4 hours of search, your tutorial saved my life . thanks

  • @andrewclayburn5920
    @andrewclayburn5920 Před 10 měsíci

    wow I wasted so many hours trying to figure out what the hell was going on before finally finding this video and solving it in seconds, thanks man I appreciate it!

  • @MushroomPower84
    @MushroomPower84 Před rokem

    Thank you for your work! I've already learned a lot by this channel.

  • @fakalakaloo
    @fakalakaloo Před 6 měsíci

    Helped a lot. Simple, clear, understandable!

  • @go_away_plz
    @go_away_plz Před rokem

    This tutorial really helped me. Thank you very much!

  • @rick.d
    @rick.d Před 10 měsíci

    couldn't have been more perfect. thanks!

  • @cosmic_9
    @cosmic_9 Před 7 měsíci

    Thank you for explaining it as well! I'm trying to comperhend every basic principle vs code and python has to offer and hit a wall here.

  • @bozok1903
    @bozok1903 Před rokem

    I watch your videos even if I know the subject you teach. You are very good at transferring your knowledge. Thanks a lot.

  • @guyonlead
    @guyonlead Před rokem

    Quick and easy! Thanks!

  • @trzztrzz2477
    @trzztrzz2477 Před 10 měsíci

    Life saver. Thank you man!

  • @whatdaro
    @whatdaro Před 8 měsíci

    great video, straight to the point. subbed

  • @TJTHEFOOTBALLPROPHET
    @TJTHEFOOTBALLPROPHET Před 11 měsíci

    Bruh, that was the best explanation on the internet! thank you!

  • @user-yl7fx6uw8q
    @user-yl7fx6uw8q Před 9 měsíci

    Thank you for this video, really helpful !

  • @LaminarRainbow
    @LaminarRainbow Před 4 měsíci

    Thank you for the quick and concise video!

  • @noekiriza5041
    @noekiriza5041 Před rokem

    Thanks, I finally found the best Tutorial 💪

  • @notgamerboy8048
    @notgamerboy8048 Před 11 měsíci

    great tuotrial, it took me a few hours to figure it out by my self last time, but this time it took like 2 mins bc of your vid

  • @JackPlaysMinecraft575
    @JackPlaysMinecraft575 Před 6 měsíci

    Thank you for this Helpful Video i was Struggling with using VScode Now i Know how to get python onto it

  • @lofgren007
    @lofgren007 Před 25 dny

    Best and simplest explanation I have come across for venv - thank you kindly.

  • @datag1199
    @datag1199 Před 11 měsíci

    Fantastic video. Thank you very much.

  • @Nand_Snowwhite
    @Nand_Snowwhite Před 11 měsíci

    Thanks for the beautiful explanaiton. Well done

  • @itskingshon
    @itskingshon Před 2 měsíci

    You're a literal lifesaver; thank you!

  • @ispeakpython
    @ispeakpython Před 4 měsíci

    Thank you sir, I've found answer of my question here after 3 weeks.

  • @azekhuoriadignity2360
    @azekhuoriadignity2360 Před 10 dny +1

    for those that did not get the (env name) in terminal path, which is supposed to be displayed in the panel after activation, its normal on Vs code right now. You can hover over the powershell or cmd button on the top of the panel to see the extensions that have contributed to the terminal environment. There you will see your virtual env running.

  • @ApolloAnalytics
    @ApolloAnalytics Před 11 měsíci

    You saved my day... Thanks 😊

  • @danieledispirito
    @danieledispirito Před rokem

    i’ve just discovered you’re italian, good video man!

  • @user-vp1tk7fg6m
    @user-vp1tk7fg6m Před 9 měsíci

    thank you very much bro, it really helped me)

  • @solomonwest9104
    @solomonwest9104 Před 5 měsíci

    You are very helpful ... you just earned a subscriber , Thanks

  • @Sanjana-nl1si
    @Sanjana-nl1si Před 4 měsíci

    Thank you. That was very helpful

  • @feelthevieww
    @feelthevieww Před rokem

    it was so help full
    nice work bro

  • @nelsonberm3910
    @nelsonberm3910 Před rokem

    This is freaking craZY Tthank yoiu

  • @enableDeepak
    @enableDeepak Před 11 měsíci

    quite helpful! what keyboard shortcut runs the program?

  • @sbj6173
    @sbj6173 Před rokem

    Thanks .that was great 😊

  • @JATARKATAR123
    @JATARKATAR123 Před měsícem

    Thanks buddy for give me this instruction
    Thank you so much

  • @anything9276
    @anything9276 Před 11 měsíci

    That was very helpful thanks

  • @katerinaprotivenskiy3680
    @katerinaprotivenskiy3680 Před 4 měsíci

    Very helpful! thanks!

  • @catnpizza
    @catnpizza Před rokem

    Thank you very much I'm very grateful!!!

  • @alexeykruglov8185
    @alexeykruglov8185 Před měsícem

    Thank you vety much> I am using this in my work.

  • @frankking5326
    @frankking5326 Před 6 měsíci

    Amazing video!! Thanks

  • @nimraiman2018
    @nimraiman2018 Před 2 měsíci

    this is exactly what i was looking for❤

  • @bensonkamau1844
    @bensonkamau1844 Před 11 měsíci +2

    actually when creating a new python file, if you create a requirements.txt under it and add modules to be used, vscode displays a button on the bottom left side asking you whether you want to create a new environment

  • @trp
    @trp Před rokem

    Never thought it was this easy

  • @joaovitor42411
    @joaovitor42411 Před 8 měsíci

    Thank you very much, man

  • @cuoi123
    @cuoi123 Před rokem

    Thank you, It to be great if you add resolve when user missing that pop-up^^

  • @pleabargain
    @pleabargain Před 6 měsíci

    Super helpful. Thank you!

  • @y.s4963
    @y.s4963 Před 11 měsíci

    First of all i love your accent and tnx for your tutorial

  • @4tmadeit
    @4tmadeit Před 10 měsíci

    thank you man !

  • @user-ys8uu5vd2f
    @user-ys8uu5vd2f Před 3 měsíci

    Thanks, this video is useful :)

  • @bneyez
    @bneyez Před 11 měsíci

    Ur the best!

  • @aditg367
    @aditg367 Před 5 měsíci

    Thank you for the video

  • @saremish
    @saremish Před 6 měsíci

    Very useful!

  • @muralidharanrajendran4098

    Big fan buddy ❤

  • @ugurcaneser
    @ugurcaneser Před 5 měsíci

    It helped a lot. Thanks!

  • @CodeOnBlocks
    @CodeOnBlocks Před 9 měsíci

    Thank you!

  • @Gamesoldier68
    @Gamesoldier68 Před měsícem

    Thank you very much for the very informative video. So i assume if you wanted to set up several virtual environments for different projects, you would just name them differently in the .venv command. Thanks again

  • @AbdulKareemAbdulRahman

    how would one upgrade the phyton in a virt environment? thanks?
    for instance my system wide python says it is 3.11.3 but my venv says it is 3.7.
    wld be grateful for any help or signposting

  • @MOHAMEDGHARBI100
    @MOHAMEDGHARBI100 Před 7 měsíci

    your language is so beautiful, thank you for your time.
    may I ask you where you from?

  • @juliusngwu
    @juliusngwu Před 7 měsíci

    Crystal clear

  • @saintsscholars8231
    @saintsscholars8231 Před 5 měsíci +3

    I was literally tearing my hair out trying to modify PATH variables and going around in circles.
    Very clear explanations. Thank you!

  • @haiclop_music
    @haiclop_music Před 6 měsíci

    Thank you so much bro

  • @user-yn8fj1rn5d
    @user-yn8fj1rn5d Před 2 měsíci

    short and clear😍

  • @alemaonalingua
    @alemaonalingua Před 6 měsíci

    NIce. Thanks

  • @imalkagunasekara8725
    @imalkagunasekara8725 Před 2 měsíci

    Great

  • @JurajBatoska
    @JurajBatoska Před 9 měsíci

    Thanks !

  • @Dasol0246
    @Dasol0246 Před 6 měsíci

    What happens when I run the .py program on another machine, do I need the pip package I installed in the virtual environment or once written I won’t need the pip package?

  • @DesperadoAH
    @DesperadoAH Před 2 měsíci

    THANK YOU ❣

  • @chycheaninh5346
    @chycheaninh5346 Před 2 měsíci

    Thank you brother

  • @minhazuddin8939
    @minhazuddin8939 Před 9 měsíci

    Thanks man😭❤

  • @pedropacheco8532
    @pedropacheco8532 Před 6 měsíci

    soooo hooot, thanks

  • @joncolt3915
    @joncolt3915 Před 6 měsíci

    bro thank you so much!

  • @thetafritz9868
    @thetafritz9868 Před 4 měsíci +1

    what do I do if I failed a couple times, tried again by deleting the .venv files and now no longer get the notification or the option to use the venv folder??

    • @pokpok9445
      @pokpok9445 Před 2 měsíci +1

      I'm a bit late but you can click on the interpreter data on the bottom-right of the window that should be called like the version of python that is installed on your computer. Then you can click at the top on "browse..." then you go in the .venv folder then scripts and python.exe

  • @charlessnachez4248
    @charlessnachez4248 Před měsícem +1

    Why the « pip install discord » int he folder didnt work but it worked in the venv environment ? Is it because of some conflict with other global python packages?

  • @media7588
    @media7588 Před 11 měsíci

    Thanks you

  • @AB-ko2mm
    @AB-ko2mm Před 5 měsíci

    Thank you

  • @anomienormie8126
    @anomienormie8126 Před 8 měsíci

    Idk what I've been struggling ten hours for when I could've just watched this and finished in 4minutes ㅠㅠㅠㅠ

  • @alessandrogolinelli8322
    @alessandrogolinelli8322 Před 3 měsíci

    bella per federico e daje romaaa

  • @kaiman3917
    @kaiman3917 Před 2 měsíci

    man i love you

  • @Matt-lf1ik
    @Matt-lf1ik Před 4 měsíci

    So are you supposed to have seperate venv folders for each project? Isnt that inecfficient as you would need multiple pip installations of the same basic things? Also would this work with git and uploading to github to work across multiple machines?

    • @AliBeats_
      @AliBeats_ Před 4 měsíci

      No, you can run multiple project from one virtual environment, 1- just use terminal to activate you're old virtual env from the old path. 2-don't forget two change the interpreter to the old virtual env, you can import anything using one venv. you just need to creat new venv when an library's update is needed so you don't corrupt your old project that are using old lib versions.

  • @En1gma2u
    @En1gma2u Před 8 měsíci

    Thank You!!, I knew I recognized the voice -- Total Python: You Can Master Python Programming in 16 Days

    • @Indently
      @Indently  Před 8 měsíci

      What’s that?

    • @En1gma2u
      @En1gma2u Před 8 měsíci

      A class on Udemy, guy name is Federico and sounds just like you.

  • @techsporadic
    @techsporadic Před 5 měsíci

    Thanks

  • @user-jk1gb7wm6z
    @user-jk1gb7wm6z Před rokem +1

    for windows ....
    python -m venv myenv
    Then activate it by following command...
    myenv\Scripts\activate
    here .... myenv is name of my environment .... u can give any name .....
    Just 2 lines of Commands..

  • @tech-n-data
    @tech-n-data Před 9 měsíci

    If I had hair, I would have pulled it out trying to figure out why I code wasn't usin the venv. Thank you for this video.

  • @schmeiser_
    @schmeiser_ Před 3 měsíci

    great video as always, btw I wanna ask why in my python, I cant import tkinter? it says " ModuleNotFoundError: No module named '_tkinter' "

  • @dylancastelli8409
    @dylancastelli8409 Před 10 měsíci

    thanks!!!!!!!!!!

  • @ivanperez4878
    @ivanperez4878 Před rokem

    you rock!

  • @anab6636
    @anab6636 Před 8 měsíci

    if I made a file organizer code in python, but I'm scared to try it out on my actual computer, can I run it here??

  • @ivosacagami121
    @ivosacagami121 Před 2 měsíci

    i`m having a problem with the venv on the windows.
    Everytime that I reopen the project, like the next day, I have to reactivate the virtual enviroment. Is that correct? Do I have another way to do it?
    what I`m doing is opening the cmd on the folder and then running "code . " to open vscode with the right directory.
    then I have to go and put the "Set-ExecutionPolicy Unrestricted -Scope Process"
    and then ".\ .venv\Scripts\activate"
    everytime. What am I doing wrong? or is that normal ?
    PLease

  • @Code4U_
    @Code4U_ Před měsícem

    Forget a .\ and searching for how to fix ps1 error ...... Thanks ❤

  • @user-fd2nh2oo4i
    @user-fd2nh2oo4i Před rokem +18

    Although I completely followed this video, the error resists:ImportError: No module named statistics what should I do?

    • @srivatsavm3892
      @srivatsavm3892 Před rokem +5

      i know this is a late reply cuz i just saw it but, after creating virtual environment you have to install your packages again using pip install

    • @Virtual4087
      @Virtual4087 Před 5 měsíci

      ​@@srivatsavm3892 Do we need to install all the packages that are already installed in our system again when we activate a virtual environment?

    • @riluwan9279
      @riluwan9279 Před 4 měsíci

      bruhh ig its inbuilt

  • @al.habibii
    @al.habibii Před 2 měsíci

    Hello, i'm creating a new folder named 'folder', and then following this step. But why after print('Hello!'), and text 'pip install discord' in vscode terminal, my vscode install discord? as i see in this video, there must be command not found: pip, but that's not happened in my vscode..

  • @boyinpyjamas
    @boyinpyjamas Před 7 měsíci

    Great video but could have mentioned how to deselect select delete venvs.

  • @gbvtech
    @gbvtech Před 6 měsíci

    why does the visual studio website says do not use the virtual environment same as a workspace folder? in your video you selected it as yes to use as a workspace folder