Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can do this without installing <strong>anything</strong> into python itself.</p> <p>You don't need sudo or any privileges.</p> <p>You don't need to edit any files.</p> <p>Install virtualenv into a bootstrap virtual environment. Use the that virtual environment to create more. Since virtualenv ships with pip and distribute, you get everything from one install.</p> <ol> <li>Download virtualenv: <ul> <li><a href="http://pypi.python.org/pypi/virtualenv" rel="noreferrer">http://pypi.python.org/pypi/virtualenv</a></li> <li><a href="https://pypi.python.org/packages/source/v/virtualenv/virtualenv-12.0.7.tar.gz" rel="noreferrer">https://pypi.python.org/packages/source/v/virtualenv/virtualenv-12.0.7.tar.gz</a> (or whatever is the latest version!)</li> </ul></li> <li>Unpack the source tarball</li> <li>Use the unpacked tarball to create a clean virtual environment. This virtual environment will be used to "bootstrap" others. All of your virtual environments will automatically contain pip and distribute.</li> <li>Using pip, install virtualenv into that bootstrap environment.</li> <li>Use that bootstrap environment to create more!</li> </ol> <p>Here is an example in bash:</p> <pre><code># Select current version of virtualenv: VERSION=12.0.7 # Name your first "bootstrap" environment: INITIAL_ENV=bootstrap # Set to whatever python interpreter you want for your first environment: PYTHON=$(which python) URL_BASE=https://pypi.python.org/packages/source/v/virtualenv # --- Real work starts here --- curl -O $URL_BASE/virtualenv-$VERSION.tar.gz tar xzf virtualenv-$VERSION.tar.gz # Create the first "bootstrap" environment. $PYTHON virtualenv-$VERSION/virtualenv.py $INITIAL_ENV # Don't need this anymore. rm -rf virtualenv-$VERSION # Install virtualenv into the environment. $INITIAL_ENV/bin/pip install virtualenv-$VERSION.tar.gz </code></pre> <p>Now you can use your "bootstrap" environment to create more:</p> <pre><code># Create a second environment from the first: $INITIAL_ENV/bin/virtualenv py-env1 # Create more: $INITIAL_ENV/bin/virtualenv py-env2 </code></pre> <p>Go nuts!</p> <h2><strong>Note</strong></h2> <p>This assumes you are not using a really old version of virtualenv. Old versions required the flags <code>--no-site-packges</code> (and depending on the version of Python, <code>--distribute</code>). Now you can create your bootstrap environment with just <code>python virtualenv.py path-to-bootstrap</code> or <code>python3 virtualenv.py path-to-bootstrap</code>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload