“Inherit global site packages” means that the packages installed on your computer (outside of the virtual environment) will be added to the virtual environment. Follow this answer to receive notifications.
These are almost completely interchangeable, the difference being that virtualenv supports older python versions and has a few more minor unique features, while venv is in the standard library.
If you build with virtualenv --system-site-packages ENV , your virtual environment will inherit packages from /usr/lib/python2. 7/site-packages (or wherever your global site-packages directory is).
virtualenv is used to manage Python packages for different projects. Using virtualenv allows you to avoid installing Python packages globally which could break system tools or other projects. You can install virtualenv using pip. Unix/macOS.
The previous answer wraps up question 1 but ignores question 2.
The general best practice I've seen for which packages to put globally:
First, the core Python packages, as these don't change with backwards-incompatible issues unless you're upgrading a major version, and you'll want whatever security fixes from a python upgrade to apply automatically to your virtualenvs.
Second, packages that are a pain to easy_install or pip install into each individual virtualenv but that don't change very often -- MySQLdb/psycopg and PIL, for example.
Pretty much everything else should go into your virtualenv's packages (I highly recommend using pip requirements files and virtualenvwrapper to make this minimally painful and easy to set up on other machines).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With