8. But wait; there’s more!
If you’re using a *NIX system, you can
probably install pip via your OS’s package
manager.
You can probably also install Python packages
using your OS’s package manager.
9.
10. So why use pip over X?
easy_install:
● I honestly don’t know, but if you enjoy parroting, click here: http:
//www.pip-installer.org/en/latest/other-tools.html#pip-comparedto-easy-install
Your OS’s package manager:
● Versions are usually outdated, especially for large projects
17. Why is this bad?
● Only one version for the entire
machine.
● You’ll end up with a lot of packages on
/usr/local
● I totally made the second one up so I
can use bullet points
18. Main use cases:
● Different projects are going to need
different versions of packages.
● Provide packages only to the projects
that need them.
20. Basic virtualenv usage...
# Creating a virtualenv...
$ virtualenv ENV # creates a directory named ENV
# Activating a virtualenv
$ source bin/activate
# Manage your virtualenv’s packages
# A new virtualenv includes pip in ENV/bin/pip
...
# Leaving a virtualenv
$ source bin/deactivate
25. For virtualenvs that you
can “pass around”
# Save all the packages you are using to a file...
$ pip freeze > requirements.txt
# Install all packages you needed from a file...
$ pip install -r requirements.txt
# Especially useful for projects with more than one person
working on it...