You've gotta show this guy the love as he always explains things in such simple terms and then gives you a little extra that you weren't expecting! Thank you sir for all the time you invest to give us great content!
0:48 why virtual environment to have a space where we can install packages specific to a certain project 0:57 example for updating from Django 1 to Django 2 1:22 each project should have its own packages separate from each other 1:34 demo: need *Python 3.3 or higher* 2:05 pip3 list 2:51 create a new virtual environment - 2:57 *python3 -m venv project_env* (project_env is the name of the project to be initialized) 3:42 activate the created virtual environment - 3:45 *source* project_env/bin/activate 5:34 if other wants to export the packages that are used 5:39 *requirement.txt* 5:56 *pip freeze* 6:25 in Linux: *pip freeze > requirements.txt* 6:55 deactivate the project *7:43** normal practice of using venv* 8:24 use of the created requirements.txt 8:35 *pip install -r requirements.txt* 9:04 one thing to mention: *it is common to put virtual environment inside your project folder, but you don't want to put project files into your virtual environment* 9:29 10:01 you shouldn't commit your virtual environment to your source control 10:16 what should be committed in version control: your requirements.txt 10:38 how to create an environment with access to system-packages 11:29 --system-site-packages 12:08 the additional packages installed in this environment won't affect the system packages 12:35 pip list --local
been to numerous pages, wikis, stackoverflows and only got confused snippets of virtual environments. Watched your video and my brain got opened and clarity shone inside... magnifico!
Great tutorial thanks. Short and informative. Below are my notes. 1. Create a seprate folder for venv data inside the project source 2. Create virtual environment -python3 -m venv {path/folder} $ python3 -m venv venv 3. Create virtual environment which have access to system packages $ python3 -m venv venv --system-site-packages 4. Activate virtual environment -source {folder}/bin/activate $ source venv/bin/activate 5. Check if venv is activated $ which python 6. List installed package pip list 7. List packages installed in venv $ pip freeze 8. Export required package to requirment.txt pip freeze > requirment.txt 9. Exit venv deactivate 10. Install packages from requirment.txt in venv $ pip install -r requirement.txt
Thanks for the helpful explanation Corey. For those folks (like me) using the fish shell, at around the 3:50 mark you'll need to enter *source py3env/bin/**activate.fish* in the terminal otherwise you'll most likely get an error like this: project_env/bin/activate (line 74): Missing end to balance this if statement if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then ^ from sourcing file project_env/bin/activate called on standard input source: Error while reading file 'project_env/bin/activate'
7:22 Creating a new virtual environment (Best practice) 4:28 If you need to use a different version of python 5:40 Exporting packages from your environment with requirements.txt file 8:25 Creating a virtual environment from a requirements.txt file 10:30 Deactivating environment 11:00 Creating a virtual environment containing all system packages 12:35 Listing packages you've installed within the environment (not system packages)
I had to watch this like at least 3 times, probably more. But Corey is still the best. If I am not going to understand it with Corey, then it was not meant to be. But I definitely got a little more each time.
Best tutorial I have seen to date regarding virtual environments, thank you! Unfortunately the wheels keep falling off 😜 Installing libraries I constantly get : "ERROR: Could not build wheels for X" With Linux it's a wormhole of issues and errors... find a solution like virtual environments for one problem, and Linux will open a door to a list of new ones 🤣😂
Corey...thank you...I have just started the road to data science and one thing I have never had a good simple explain action if were basics of setting up environments without much hassle. I followed this like ABC. I understand what is happening, what to do, how to undo it and how to pass it on.
Right on time. I usually do Python work in Lambda/Cloud Functions environments so my understanding of setting up projects on the desktop is lacking. I always struggle with setting up projects and getting virtual environments working when I have to code the traditional way. The MacOS transition to the z shell has made it worse. Luckily Corey is my Python guru, problem solved. This is the number one Python channel on RUclips.
Thank you for such an amazing video, You seem to know exactly what your student has in mind and what problems he is trying to solve while watching your videos.
As a newbie I'm super frustrated by the whole python setup thing cuz Mac has 2 versions of python. It drove me nuts and I found your video -- THANK YOU
Dear Sir. Thanks for the great work !!! I was looking for a env tutorial for Mac and this is exactly what I found here !!! Great job. I give like and ... subscribe ! Greetings from Belgium.
@corey shafer thanks for the great videos and sharing you knowledge with us. its nice to watch an informative video from someone who speaks clearly;y and is professional and to the point. THANK YOU
I just wanted to comment because I really enjoyed this video and wanted to say thanks for putting it together. Very informative and to the point. Cheers!
This is great. One thing I'm not sure about, when you use '--system-site-packages' option, I assume that nothing you do to those packages in the venv affects the system packages. Like testing a package upgrade. Seems obvious but wanted to be sure, lol.
You've gotta show this guy the love as he always explains things in such simple terms and then gives you a little extra that you weren't expecting! Thank you sir for all the time you invest to give us great content!
Thanks!
0:48 why virtual environment
to have a space where we can install packages specific to a certain project
0:57 example for updating from Django 1 to Django 2
1:22 each project should have its own packages separate from each other
1:34 demo: need *Python 3.3 or higher*
2:05 pip3 list
2:51 create a new virtual environment - 2:57 *python3 -m venv project_env* (project_env is the name of the project to be initialized)
3:42 activate the created virtual environment - 3:45 *source* project_env/bin/activate
5:34 if other wants to export the packages that are used 5:39 *requirement.txt*
5:56 *pip freeze*
6:25 in Linux: *pip freeze > requirements.txt*
6:55 deactivate the project
*7:43** normal practice of using venv*
8:24 use of the created requirements.txt
8:35 *pip install -r requirements.txt*
9:04 one thing to mention: *it is common to put virtual environment inside your project folder, but you don't want to put project files into your virtual environment*
9:29
10:01 you shouldn't commit your virtual environment to your source control
10:16 what should be committed in version control: your requirements.txt
10:38 how to create an environment with access to system-packages
11:29 --system-site-packages
12:08 the additional packages installed in this environment won't affect the system packages
12:35 pip list --local
this is awesome
thank you!!
You are just too great. Nowadays I search RUclips with your name I be like "virtual environment in Python Corey Schafer" .
So simple, yet elegant and concise explanation of something I just now comprehended completely. Congrats Corey, you are a phenomenal teacher!
These virtual environments are a really clever way to not run into problems when you have different projects with different requirements. I love it!
been to numerous pages, wikis, stackoverflows and only got confused snippets of virtual environments. Watched your video and my brain got opened and clarity shone inside... magnifico!
I love how simple and straightforward this video is. Whenever I want to learn something new about Python, I first check to see if you've covered it.
Simple, direct and well explained.
Thanks man, this helped me!
Great tutorial thanks. Short and informative.
Below are my notes.
1. Create a seprate folder for venv data inside the project source
2. Create virtual environment
-python3 -m venv {path/folder}
$ python3 -m venv venv
3. Create virtual environment which have access to system packages
$ python3 -m venv venv --system-site-packages
4. Activate virtual environment
-source {folder}/bin/activate
$ source venv/bin/activate
5. Check if venv is activated
$ which python
6. List installed package
pip list
7. List packages installed in venv
$ pip freeze
8. Export required package to requirment.txt
pip freeze > requirment.txt
9. Exit venv
deactivate
10. Install packages from requirment.txt in venv
$ pip install -r requirement.txt
I was so much confused about the environment thing earlier but after watching the video you made so easy for me to understand. You're great!
Thanks for the helpful explanation Corey.
For those folks (like me) using the fish shell, at around the 3:50 mark you'll need to enter *source py3env/bin/**activate.fish* in the terminal otherwise you'll most likely get an error like this:
project_env/bin/activate (line 74): Missing end to balance this if statement
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
^
from sourcing file project_env/bin/activate
called on standard input
source: Error while reading file 'project_env/bin/activate'
The introduction to venv that I was seeking - concise yet complete.
7:22 Creating a new virtual environment (Best practice)
4:28 If you need to use a different version of python
5:40 Exporting packages from your environment with requirements.txt
file
8:25 Creating a virtual environment from a requirements.txt file
10:30 Deactivating environment
11:00 Creating a virtual environment containing all system packages
12:35 Listing packages you've installed within the environment (not system packages)
Best video on venv that I found of the six I watched (and didn't even care to finish watching in some cases).
I had to watch this like at least 3 times, probably more. But Corey is still the best. If I am not going to understand it with Corey, then it was not meant to be. But I definitely got a little more each time.
On all of your videos (that I've watched) you fill knowledge gaps perfectly.
This video explains everything...and then goes beyond! Loved it.
You're a great teacher. All of your video's are clear and interesting. Especially for an advanced noob like me.
thank you for clearling up, not only how it's done, but also how the convention is
Best tutorial I have seen to date regarding virtual environments, thank you! Unfortunately the wheels keep falling off 😜 Installing libraries I constantly get : "ERROR: Could not build wheels for X" With Linux it's a wormhole of issues and errors... find a solution like virtual environments for one problem, and Linux will open a door to a list of new ones 🤣😂
Corey...thank you...I have just started the road to data science and one thing I have never had a good simple explain action if were basics of setting up environments without much hassle. I followed this like ABC. I understand what is happening, what to do, how to undo it and how to pass it on.
Right on time. I usually do Python work in Lambda/Cloud Functions environments so my understanding of setting up projects on the desktop is lacking. I always struggle with setting up projects and getting virtual environments working when I have to code the traditional way. The MacOS transition to the z shell has made it worse. Luckily Corey is my Python guru, problem solved. This is the number one Python channel on RUclips.
concise, clear and perfectly delivered. I will be using this a lot from now on.
As someone coming to Python from another programming language, this was very helpful!
Yo dude this is like the best guide in this topic
Really helped me understand the importance of virtual environment
It's like whatever my problems are, you have a solution or tutorial. Thanks soooo much!
Honestly, Corey is a life saver!
I click the like button first and then watch the videos , 'cause i know its gonna be awesome
same for me :)
Thank you for such an amazing video, You seem to know exactly what your student has in mind and what problems he is trying to solve while watching your videos.
Awesome - much simpler than pipenv ... Thank you for posting that video.
pretty good idea? bro gotta hand it to you. so clarifying illustrations of venv. thank you for another great tut
Thank you. I learned Python Virtual Environment Quickly
-system-site-packages was a good tip 👍
Great videos Corey. Clear and perfect explanation.
As a newbie I'm super frustrated by the whole python setup thing cuz Mac has 2 versions of python. It drove me nuts and I found your video -- THANK YOU
Dear Sir.
Thanks for the great work !!!
I was looking for a env tutorial for Mac and this is exactly what I found here !!!
Great job.
I give like and ... subscribe !
Greetings from Belgium.
Simple and straight to the point. Thank you for this. Much appreciated.
this is very helpful. thanks very much. i was puzzled from last 4 days OMG. thanks again...
Still works - virtual enviroments can be pretty difficult for beginners, thanks for explaining so detailed
Very clear explanation and covers only what is needed, Thanks for this crisp and clear video clip!
You use terminal so efficiently amazing
Amazing video, straight to the point
This guy is the dopest guy and I love his videos.
This is exactly what I need, thank you so much.
Wow. Genius instructor.
Super clear explanation!
Super thorough! Thank you
Very useful even for people with low knowledge at english) thx 🤙
Excellent video to explain the basics of virtual environments! Thank you!!
thanks for the best explanation I ever seen
thanks very much for the simplest explanation !
Thanks! I finally got my head around venv...
@corey shafer thanks for the great videos and sharing you knowledge with us. its nice to watch an informative video from someone who speaks clearly;y and is professional and to the point. THANK YOU
Incredible videos. Kept answering my questions as he went. Keep up the good work.
Thank you so much. Very clear explanation.
This was so clear, concise, and comprehensive. Thanks so so much!
Super. What exactly is needed.
Man! Your channel is awesome
Keep up with the awesome work
Great explanation. Thanks it was very helpfull Cory
You explained so clearly! Thank you!
I just wanted to comment because I really enjoyed this video and wanted to say thanks for putting it together. Very informative and to the point. Cheers!
Great job Corey. I really appreciate the detailed tutorial.
Exactly what I was looking for. Thank you!
Thank you. Very well explained!
Couldn't have been explained better, thanks!
This video helped me so much, thanks!
fantastic overview, which is why the like-to-dislike ration is the highest i've ever seen
THANK YOU SIR! it really helped me out i was trying for very long time
Very clear explanation! Thanks!
Such a life-saver video. Thanks a lot man
I need to say I have smashed the like button
Very helpful. Thanks, man!
This was super helpful
Man alive! This is useful
Thanks man! I love you. You just saved me.
Super helpful, Thank you!
great video. thanks!!
Your videos are Awesome! Thanks for sharing your knowledge.
great explanation! thanks a lot!
Always appreciate your video Corey, Thanks :)
Great tutorial!
Thanks, Corey! Very nicely done!
Clarity!
Thank you
Thank you Mr CoreyMS
You are great thalaiva...😎
Love your videos, Mate.
Excellent demo. Thanks.
Thanks for this awesome tutorial. cheers!
Thanks, very helpful stuff...
Great explanation skills. Thanks!
3:34 Well explained
Thanks for the video, as always is explained perfectly!
amazing tutorial thank you!
Thanks a lot man! That video was amazing!!
i love the content. pls make use of windows comments too
So clear. Thank you.
Just what I needed! Thanks!
This is great. One thing I'm not sure about, when you use '--system-site-packages' option, I assume that nothing you do to those packages in the venv affects the system packages. Like testing a package upgrade. Seems obvious but wanted to be sure, lol.
Great Video!