Sometimes you're going to want to see which Python packages
you have installed.
So there's a few different ways of doing this.
There's the hard way which you could try.
You could try to import the package from your Python shell.
So you could do something like this, 'from colorama import *',
everything. Okay. No complaints.
But what if I did 'from
packagethatclearlydoesnotexistonmycomputer
import', anythingelse,
a 'thing'. We're going to see, 'ModuleNotFoundError', and that
this module, this package does not exist.
So you could always try that.
But you're really, you're guessing at that point, and that's no good.
Now, a better way to live your life is to simply type 'pip
freeze', and this actually isn't going to freeze anything.
I'm sure there's a reason why they call it 'freeze', but it
doesn't actually do anything.
It just sort of takes a snapshot of all of your packages
that are installed, and gives you a list.
So when I hit 'Enter', you'll see a long list of all these different
packages that I have.
And I use pretty much all of these on a day to day basis,
so I keep them.
And if you're on a Unix like system, I'll show you a cooler shortcut here.
This may or may not work on Windows, though.
You can do 'pip freeze | grep',
and then let's look for "colorama". "colorama", or just "color" even.
So, we've got a package, 'colorama',
the version is 0.4.3.
Now, going back to this big list here, if you do a 'pip freeze'
on your computer, and you don't necessarily recognize everything
that's in there, that's actually okay.
Chances are it was a dependency that was installed.
So, like when I installed Django a couple of lessons ago,
it comes with a few requirements.
So let's do 'pip show Django', and it is 'Required-by: wagtail'.
So if I did 'pip install wagtail' it would get Django for me,
django-trebeard, django-taggit, and django-debug-toolbar.
All of these packages require Django.
So if I installed 'django-debug-toolbar, it might actually
install Django for me as well.
Let's do another one.
'pip show requests'.
This is a very popular package, and this one is required
by requests-toolbelt, poetry, twine, PyVimeo,
so the Python Vimeo API, which I've recently been using,
and proxy-requests.
And so if I installed PyVimeo, so I did 'pip install PyVimeo',
it would also go ahead and get 'requests' for me as well.
And that's why you might see a package in there that you
don't necessarily know how it got in there. It's called a dependency,
and so that's totally normal.
[no audio]