python: How to create virtualenv without internet connection

If you update virtualenv to a version >= 1.10, then it will never connect to the internet regardless of any flag (see the "Changes & News" section here)


The internet connection is used to install the setuptools and pip packages in the virtual environment. Older versions of virtualenv will try to download these two packages, while newer versions ship with them and will just unpack them when necessary.

Since your virtualenv version (1.7.2) is lower than 1.10, you can use the --never-download flag in order to avoid connecting to the internet. Later on, you can install (offline) what you need.

Here (section "The --extra-search-dir Option") it's explained how to bootstrap setuptools and pip without an internet connection. You basically need to get the .egg files for these packages and put them somewhere local, and then you need to do:

$ virtualenv --extra-search-dir=/path/to/eggs --never-download ENV