Python for the .NET Developer Transcripts
Chapter: Package management and external libraries
Lecture: Concept: Installing Python packages
0:00 Let's quickly summarize installing requirements. Now I have a quick little shortcut that I'm using here to create a virtual environment.
0:07 The idea is you say Python -m venv venv and then you activate it and the way that happens on Windows, POSIX system
0:17 or MAC OS, and Linux is slightly different but I've shown you that a couple of times. So we're going to create a virtual environment and activate it.
0:23 And then maybe we'll have some kind of requirements.txt or you can just individually install them. So here you can see that we're looking
0:30 at the contents of our requirements.txt. It has three requirements, httpx bs4, and colorama. And then when we want to install them
0:37 we just say pip install all the requirements in this file. The way we do that is way say pip install -r and then the filename.
0:45 This can be a full path, but because we're in this working directory, we can just use the requirements.txt file.
0:51 We also saw that PyCharm will manage these and automatically suggest installing them as soon as you type them into the requirements.txt file
0:59 if it's at the top level of the project. If it's in some sub folder, PyCharm ignores it. And you can see it downloads some of the files
1:06 it will use cached ones if you've downloaded them before, and just installs them in all of their dependencies, and your new virtual environment
1:13 is ready to start working with all these libraries.