Python Tutorial: VENV (Windows) - How to Use Virtual Environments with the Built-In venv Module

  Рет қаралды 562,391

Corey Schafer

Corey Schafer

5 жыл бұрын

In this Python Programming Tutorial, we will be learning how to use virtual environments on the Windows operating systems with the built-in venv module. We will learn how to create them, activate them, remove them, and much more. Let's get started...
VENV (Mac & Linux) - • Python Tutorial: VENV ...
✅ Support My Channel Through Patreon:
/ coreyms
✅ Become a Channel Member:
/ @coreyms
✅ One-Time Contribution Through PayPal:
goo.gl/649HFY
✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
✅ Corey's Public Amazon Wishlist
a.co/inIyro1
✅ Equipment I Use and Books I Recommend:
www.amazon.com/shop/coreyschafer
▶️ You Can Find Me On:
My Website - coreyms.com/
My Second Channel - / coreymschafer
Facebook - / coreymschafer
Twitter - / coreymschafer
Instagram - / coreymschafer
#Python #venv

Пікірлер: 531
@coreyms
@coreyms 5 жыл бұрын
In my older virtualenv video, I got a ton of requests to show how to use virtual environments on Windows. I hope this helps!
@InternationG
@InternationG 5 жыл бұрын
Hey Corey, thank you as always, i was trying to debug a Python for loop and was not sure if you talk about it anywhere. Also realized that sublime text 3 does not actually feature a python debugger, would appreciate your thoughts on this.
@guipa
@guipa 5 жыл бұрын
Thank you for all your videos. You should do one someday for pipenv!
@guipa
@guipa 5 жыл бұрын
And multiprocessing/multithreading
@guipa
@guipa 5 жыл бұрын
And sockets!
@coreyms
@coreyms 5 жыл бұрын
@@guipa I already have one for Pipenv. You can find that here: kzbin.info/www/bejne/sHW8fWVohrOcjc0
@matiasgomez9416
@matiasgomez9416 4 жыл бұрын
pip list > 2:13 python -m venv project_env > 2:29 project_env\Scripts\activate.bat > 3:24 where python > 3:46 pip install requests > 4:48 pip install pytz > 5:00 pip list > pip freeze > 5:47 --> copy information 'pip freeze' --> create requirements.txt > 6:37 --> paste information there deactivate > 7:16 rmdir project_env /s > 7:33 >> NEW PROJECT 8:48 python -m venv my_project\venv > 8:55 my_project\venv\Scripts\activate.bat pip install -r requirements.txt > 9:46 cd my_project > 10:50 --> create new file 'script.py' deactivate > rmdir venv /s > python -m venv venv --system-site-packages > 13:30 venv\Scripts\activate.bat > pip list > pip install SQLAlchemy pip list --local
@i3130002
@i3130002 4 жыл бұрын
should get pinned
@amandeepmaroke6267
@amandeepmaroke6267 4 жыл бұрын
The second hero after Corey Schafer :)
@marcop-mb506
@marcop-mb506 4 жыл бұрын
Thank you sir.
@fabiosegato8324
@fabiosegato8324 4 жыл бұрын
great job mate, thanks!
@desifoodie8371
@desifoodie8371 4 жыл бұрын
Is there any way to find out my existing virtual env?
@user-gx9hk8gt3k
@user-gx9hk8gt3k 5 жыл бұрын
Thank you for this tutorial! I couldn't figure out how to use VENV on my own, even though I read a book called " Test Driven Development" because the author explained how to use VENV on mac. Corey, you're the man!
@doneenhesse8153
@doneenhesse8153 5 жыл бұрын
This has been so helpful! My class focused mostly on programming, and so we didn't really understand what we were doing during setup, but your videos make it very clear and easy! Thank you!
@Capt_X
@Capt_X 5 жыл бұрын
Corey...You are the Guru of python world..thanks a lot for sharing your knowledge as always!
@pragatisingh192
@pragatisingh192 4 жыл бұрын
This is just perfect. I had been looking to understand venv for quite sometime now, and this clears it all. Great job!!!
@SamarHussain1
@SamarHussain1 Жыл бұрын
This is the best venv tutorial that I've ever seen. Its bookmarked in my browser for over 1.5 years now. I get back to it whenever I miss something. Thanks man (y)
@simonolofsson7488
@simonolofsson7488 5 жыл бұрын
This is exactly what I needed just now for my project which is rapidly growing in complexity. Thanks Corey!
@parthzala9426
@parthzala9426 4 жыл бұрын
Great tutorial! I am a hobbyist programmer, not an expert. I have been learning my self and this really helped.
@micahjesse6580
@micahjesse6580 2 жыл бұрын
This is the best video I've seen this year so far!!! I might be exaggerating but you sir have helped me solve a problem I was working on for the last 20+ hrs!
@hangfirers
@hangfirers Жыл бұрын
Thank you so much! I’ve searched and read and tried everything on the net on how to set up venv but this is the only one that worked.
@JSRAumDhyanam
@JSRAumDhyanam 4 жыл бұрын
Corey, I watched lot of videos about the environment and virtual environment but could not understand. Your explanations technique is the best. Thanks.
@bryanaguilar402
@bryanaguilar402 4 жыл бұрын
This was great. I was thinking of questions as the video moved along and then you ended up answering them all. Great work Corey.
@tagifts
@tagifts 2 жыл бұрын
He does that doesn't he. One of the most clear videos on venv.
@mihaigrigore2136
@mihaigrigore2136 5 жыл бұрын
Thank you Corey for this excellent video on virtual environments. I needed it. You do not assume anything as known and this is very good, especially for beginners. For me, the best explanation on this topic I found!
@ayodele_great
@ayodele_great 5 жыл бұрын
Many thanks for this tutorial. You have saved me from what I spent a whole weekend trying to figure out.
@kelvinokelvino783
@kelvinokelvino783 3 жыл бұрын
i was totally confuse and frustrated just before completing the 17 minutes of this video honestly i feel really relief now.. you got a new fan now man..... thank you...
@ife_jeremiah
@ife_jeremiah 2 жыл бұрын
This is a simple and straight to the point tutorial. Well done man. You've just gotten a subscriber.
@legends_talk1
@legends_talk1 2 жыл бұрын
Me too that was one of the best tutorials for real
@ronilif
@ronilif 2 жыл бұрын
Thank you Corey, I almost gave up trying to work with venv, until i saw this brilliant post...
@rVnikov
@rVnikov 5 жыл бұрын
Yet another video from maestro Schafer that makes difficult subject looks pretty easy. Respect!
@drissaitkassimusic
@drissaitkassimusic 4 жыл бұрын
This guy is a real instructor. Great work a lot of effort there thank you
@isagive
@isagive 2 жыл бұрын
Thank you Corey, you actually explained away all the questions a noob like me came with. Things I just didn't understand and most videos skip, I guess cuz its obvious to the creator. Very helpful tutorial 🙏 thank u
@donnie1581
@donnie1581 4 жыл бұрын
jesus you don't know how much this helped me. All tutorials I've watched were done on Mac haha
@francisguchie1973
@francisguchie1973 Жыл бұрын
This video is a simplified as a sip on a cup of coffee thank you so much Corey
@ItzSenaCrazy
@ItzSenaCrazy 5 жыл бұрын
I really needed this video. Thanks Corey!!
@AhmetAnilDindar
@AhmetAnilDindar 5 жыл бұрын
This is a very good video to learn venv module in short time. I appreciate your work.
@thomaskirsch2209
@thomaskirsch2209 3 жыл бұрын
Great videos Corey. You are the go to when I am looking to understand something python. Thanks for helping the community!
@bobfreeedu
@bobfreeedu 2 жыл бұрын
You are the best I have been like 2hour trying to figure it out , and with you it took like 1min
@avivran1198
@avivran1198 4 жыл бұрын
Very good one! Thank buddy. I like your videos. Your attitude and way of passing the stuff to your viewers is just excellent.
@alex08585
@alex08585 3 жыл бұрын
This video saved me in setting up venv in windows, still relevant in 2021
@st4willow
@st4willow 5 жыл бұрын
Thank you so much Corey for making these wonderful videos. They are all easy to understand and follow. I learn so much from them. I will join patreon to contribute to the group. Thank you for all you do!
@coreyms
@coreyms 5 жыл бұрын
Thanks! That’s a huge help!
@Quaght
@Quaght 3 жыл бұрын
This was so helpful and concise. Thank you very much from a Python (heck, programming in general) noob!
@p.9227
@p.9227 5 жыл бұрын
This video really helps me a lot. Hope you'll make more videos like that.
@bonnfranks5488
@bonnfranks5488 3 жыл бұрын
My man...I've been struggling with this. Great video. Thank you so much.
@stardevilyn
@stardevilyn 5 ай бұрын
This is very well explained and easy to follow. Thanks for the tutorial!
@t.w.freiburg6125
@t.w.freiburg6125 4 жыл бұрын
Great. Finally even me understood this stuff. I'd have a question. When I use venv and when I should use docker? A tutorial of this kind for docker would be awesome. Thanks a lot.
@ajitkumar15
@ajitkumar15 2 жыл бұрын
Thank you so much for resolving the issue. other videos on KZbin wasted my time.
@pipertripp
@pipertripp 5 жыл бұрын
Super helpful. Clear, concise, to the point. Thx much, m8.
@kannanchandrasekaran3561
@kannanchandrasekaran3561 4 жыл бұрын
This is helpful Corey, comprehensive and good phase!
@nigelemccoy1534
@nigelemccoy1534 2 жыл бұрын
This guy is the GOAT, simple and easy tutorials! This helps alot!
@scotttct
@scotttct 3 жыл бұрын
Thanks Corey for creating this, I think every KZbin turorial uses Mac, and I could not find a decent source for learning Virtual Environments...
@prateekupadhya1523
@prateekupadhya1523 Жыл бұрын
Amazing tutorial - No one explains it like you do Corey!
@nicolasduque3871
@nicolasduque3871 4 жыл бұрын
This video was great for me, I'm just learing python for the first time and as a windows user it was easy to follow the steps, congratulations. It would be great if you are able to add the english subtitles in the video because as me that I'm not an english person many other people could watch the video easer reading the subtitles
@pierrelesage1535
@pierrelesage1535 2 жыл бұрын
Never found a more fitting video to my problem, thanks a lot!!
@jake8217
@jake8217 4 жыл бұрын
Man, you are just amazing. Very clear explanations. Saved me a lot of trouble.
@VEGETADTX
@VEGETADTX 3 жыл бұрын
The single most important Python tutorial since Python's existence. Virtual environments are the most effective anti-hair loss treatment ever invented :)
@ShahZ
@ShahZ 3 жыл бұрын
Thanks @Corey Schafer. trying to follow some Django tutorial on KZbin but just couldn't activate the virtual env, windows would accept the CMD but won't activate the venv : Setup: win 10, gitbash, python 3.7 Create the venv: python -m venv my_dir Activate the venv: source my_dir/Scripts/activate Stackoverflow to the rescue. Love your work btw thanks from the rest of us.
@louism.4980
@louism.4980 5 ай бұрын
Thank you so much, love how simple and clear this tutorial is! :)
@onepercentdaily8772
@onepercentdaily8772 Жыл бұрын
Even after 4 years, it is still a valid a video 😍
@jackignatev
@jackignatev 2 жыл бұрын
Incredibly useful! Big thanks for detailed description and instructions
@arthurfelde5437
@arthurfelde5437 3 жыл бұрын
You are talking very fast, but you covered everything important to know. Many Thanks for that
@daniyarkaisan8387
@daniyarkaisan8387 3 жыл бұрын
Thank you! That was the best explanation I encountered on KZbin!
@AegirAexx
@AegirAexx 4 жыл бұрын
Thank you Corey. All this virtual environment stuff was really confusing regarding how many of them there are. I'm going to stick with the baked in one, venv.
@mistwire
@mistwire 4 жыл бұрын
Thanks for posting this, now I finally get how to use it in Windows :-)
@rafaelmrtnz
@rafaelmrtnz 9 ай бұрын
Thank you, that was really informative! Clears up questions.
@soumyajitsarkar2372
@soumyajitsarkar2372 3 жыл бұрын
This is the best video on the subject of python virtual environment! Thank You .
@financephofun7090
@financephofun7090 2 жыл бұрын
Thank you for sharing! saves a ton of time, trying to search for solutions on your own
@markettext
@markettext 3 жыл бұрын
Good video, cleared a lot up. The programming is easier than the setup.
@tullymars420
@tullymars420 3 жыл бұрын
Fantastic video!! I am so grateful for this content!! I fell like I just made a leap in my coding journey!! Thank you so much!!!
@xsandwichxxsandwichx1778
@xsandwichxxsandwichx1778 2 жыл бұрын
Thx Corey! This video is still helping me out in 2022
@pcbekri340
@pcbekri340 11 ай бұрын
you are awesome i don't have words to describe how helpful this video was thanks alooot man
@MosharofHossainZitu
@MosharofHossainZitu 4 жыл бұрын
Thanks Corey Schafer, it was a very helpful tutorial!
@ZajoSTi
@ZajoSTi 3 жыл бұрын
Best venv tutorial hands down. Thank you. Subscribed :)
@sonali_dhamanekar
@sonali_dhamanekar 3 жыл бұрын
Loved the solution finally my problem is solved.. bless you man.
@yash9089
@yash9089 3 жыл бұрын
Thank you for this, you are the foundation of whatever i do or develop related to python
@sameerspl
@sameerspl 5 жыл бұрын
Awesome Man . You are awesome Corey . Thanks a ton . I love the way you make things simpler .
@user-di4bt7qu2i
@user-di4bt7qu2i 5 жыл бұрын
Pretty much what the rest of the comments say - great video and thanks once again!
@larsalbrecht6964
@larsalbrecht6964 5 жыл бұрын
Very clear and super helpful, thanks a lot for this tutorial!
@cm_dev
@cm_dev 3 жыл бұрын
Your videos are the best. Thanks for sharing your knowledge.
@polakpuckstopper
@polakpuckstopper Жыл бұрын
superb video that provided me with everything I needed - no more, no less. thanks so much!
@JohnJohn-bo2fo
@JohnJohn-bo2fo 4 жыл бұрын
Great video. With a lot of best practice tips, that we need to know. Thank you very much.
@Shmoji
@Shmoji 5 жыл бұрын
Thank you so much. Do you need to activate the virtual environment anytime you are working on a project or just whenever you need to upgrade/add/change packages or dependencies?
@averydrago
@averydrago 4 жыл бұрын
Very helpful and you make it very intuitive, thank you!
@kyle9371
@kyle9371 4 жыл бұрын
Had trouble activating venv so I had to cd into Scripts, dir to see the contents and activate.bat, but it worked! thnx
@fillipemadureira9210
@fillipemadureira9210 5 жыл бұрын
Corey, I tried running venv but I got this error: Error: Command '['C:\\Users\\Fillipe Madureira\\Desktop\\project_env\\Scripts\\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 101. Can't find what it means... Any idea? Thanks for the help and all the tutorials, man. They have been incredibly useful to a newcomer.
@pedrograngeiro3849
@pedrograngeiro3849 3 жыл бұрын
Thank you so much. In 2021 this video is really good, but i had changed the second command to "python3 -m venv project_env". Just add the 3 in python.
@shreyraval3284
@shreyraval3284 3 жыл бұрын
Most simplest explanation there can ever be! 100000%
@wz4735
@wz4735 2 жыл бұрын
Thank you for showing this :) You made it looked so easy
@gburbano92
@gburbano92 3 жыл бұрын
@ 3:34 my issue was solved thanks for the content!
@pready5082
@pready5082 4 жыл бұрын
Loved it! So detailed and clear
@mjj2u2
@mjj2u2 2 жыл бұрын
Great job. I found this very helpful.
@salarghaffarian4914
@salarghaffarian4914 3 жыл бұрын
You are the best instructor!
@cborrero2000
@cborrero2000 2 жыл бұрын
Amazing and comprehensive video, Many thanks Corey.
@Gurfbagel
@Gurfbagel 2 жыл бұрын
Thanks, this was really helpful for me!
@tymothylim6550
@tymothylim6550 3 жыл бұрын
Thank you very much for this video :) It is very helpful and I learnt a lot!
@maxwellnganyadi922
@maxwellnganyadi922 3 жыл бұрын
This has cleared up so much for me! Thanks!
@kanishkmair2920
@kanishkmair2920 4 жыл бұрын
Hey Corey, though 'where python' shows similar to what you found, while implementing it doesn't default to the 2nd option. As of now, I've been downloading the already present Pillow and other libraries in the venv. Any ideas to solve this redundancy?
@aliyanpops6424
@aliyanpops6424 3 жыл бұрын
Thanks sir you're a blessing you're way of explanation is easy and interesting.
@pickavana8056
@pickavana8056 2 жыл бұрын
Thanks for this. I had read that you should create a virtual environments folder and then create all environments in that folder. Im using VSCode so i tried this and set ENV path. I can easily toggle between environments by selecting python interpreter, but Im getting an odd issue that I can run a script in terminal or debug but when I Ctrl Alt N to run, I get "module not found" even though code shows it is found (no underlines etc). I will try this method instead. You had project on desktop. With multiple projects, is it ok to have "py" folder on desktop and then proj1, proj2 etc as subs? What editor do you use?
@andreyminin7259
@andreyminin7259 3 жыл бұрын
This video is PERFECT!!! Can you make all youtube tutorials, please? :) Thank you!!
@mayanksinha509
@mayanksinha509 2 жыл бұрын
thank you sir your video clear my lost of doubts
@letudiantg474
@letudiantg474 4 жыл бұрын
Hey Corey, I'm following your tutorial and it has been an amazing journey, I really appreciate the good explanations on each topic. I have a quick clarification, I'm using VSCode and if I would like the VSCode to use the current packages inside my venv folder for my current project how do I get it to refer the venv folder instead of the standard installation of python. I got VScode to point the venv folder for python.exe (by editing the settings.json for my workspace) but i would like it to use the rest of the libraries(eg. pandas, matplotlib etc) installed in there which i dont have in the root python folder on my machine.
@sapien1877
@sapien1877 3 жыл бұрын
Thank you so much, exactly what I needed!
@lskk445
@lskk445 5 жыл бұрын
Hi Corey, Thanks a ton for videos, I had a question I installed some libraries, for eg ,rasa_nlu in venv , but when I run jupyter notebook , notebook shows still old version, How can i use venv libraries in jupyter notebook, Thanks in advance
@marinaurrey5246
@marinaurrey5246 5 жыл бұрын
Thank you for this video! It's super understandable and everything working. That's what I was looking for. Thank you)
@okechukwubenjamin7280
@okechukwubenjamin7280 2 жыл бұрын
Best tutor that ever seen, this is so helpful to me you literally solved my problem, God bless you❤️❤️❤️
@christosgeorgiadis7462
@christosgeorgiadis7462 2 жыл бұрын
Very clear and to the point, thank you!
@Vivian-ve1qt
@Vivian-ve1qt Жыл бұрын
Very well explained. So grateful for these videos. 🙏
@allaabdella4794
@allaabdella4794 4 жыл бұрын
Thanks, very good tutorial Corey!
@pradhumnsharma5982
@pradhumnsharma5982 3 жыл бұрын
Awesome and Easily understandable explaination.
@arctic-1878
@arctic-1878 3 жыл бұрын
Excellent tutorial, thank you! 😀
@hikarispringsummer481
@hikarispringsummer481 4 жыл бұрын
Thank you !!!! it really solved my problem, it's reaaaaaaaally healpful !
5 Common Python Mistakes and How to Fix Them
29:19
Corey Schafer
Рет қаралды 287 М.
Clowns abuse children#Short #Officer Rabbit #angel
00:51
兔子警官
Рет қаралды 73 МЛН
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 6 МЛН
Best KFC Homemade For My Son #cooking #shorts
00:58
BANKII
Рет қаралды 55 МЛН
УГАДАЙ ГДЕ ПРАВИЛЬНЫЙ ЦВЕТ?😱
00:14
МЯТНАЯ ФАНТА
Рет қаралды 3,1 МЛН
Python Virtual Environment and pip for Beginners
30:39
Dave Gray
Рет қаралды 24 М.
The Algorithm Behind Spell Checkers
13:02
b001
Рет қаралды 408 М.
PhD AI student explains how China already have won in AI..
13:28
livinlavidaluke
Рет қаралды 54 М.
The Complete Guide to Python Virtual Environments!
15:52
teclado
Рет қаралды 335 М.
Modern Python logging
21:32
mCoding
Рет қаралды 163 М.
My Python Development Environment Setup - Full Tutorial
20:39
Tech With Tim
Рет қаралды 213 М.
Clowns abuse children#Short #Officer Rabbit #angel
00:51
兔子警官
Рет қаралды 73 МЛН