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...