Modern Python Projects Transcripts
Chapter: Python versions and packages
Lecture: Using a virtual environment
0:00 So, we created an activated, a virtual environment.
0:04 We know that it's active because the prompt in our terminal has changed.
0:08 But how do you work with this virtual environment?
0:10 Well, now we do everything that we would do normally when building a python project
0:14 If you install a package with pip,
0:17 it will be installed inside this virtual environment.
0:20 You can actually see that. Currently,
0:21 we don't have any packages installed by running pip freeze command.
0:27 Let's install Django here. When we do pip freeze again,
0:35 we can see that we have Django installed.
0:37 If you want to stop using a virtual environment,
0:40 you just need to run the activate command in your terminal.
0:43 When you call the activate, it will revert all the changes that the activate command did.
0:47 So, it will go back to using the global python version and global pip packages
0:52 If we now run, pip freeze,
0:55 you can see that we no longer have Django 3 that we just install.
0:59 We are outside of a virtual environment.
1:01 So now we're back to the global packages and here we have Django 2 that we
1:06 installed in the previous lessons and some other packages like requests.
1:11 Finally, If you ever want to get rid of a virtual environment,
1:14 you can just delete the folder, where the virtual environment was created.
1:19 In our case, if we want to remove the my_first_virtualenv and we simply delete that folder.