Last active
January 10, 2017 10:30
-
-
Save michaelxor/8136225 to your computer and use it in GitHub Desktop.
A clean virtualenv with pip and setuptools (formerly distribute). Only requirement is a local python install. Adapted from http://stackoverflow.com/a/5177027
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Name your first "bootstrap" environment: | |
INITIAL_ENV=pymordial | |
# Options for your first environment: | |
ENV_OPTS='' | |
# Set to whatever python interpreter you want for your first environment: | |
PYTHON=$(type -P python) | |
# Latest virtualenv from pypa | |
URL_BASE=https://github.com/pypa/virtualenv/tarball/master | |
# Name on local fs | |
TAR_NAME=virtualenv-tmp.tar.gz | |
# --- Real work starts here --- | |
curl -Lo $TAR_NAME $URL_BASE | |
tar xzf $TAR_NAME | |
# Discover the name of the untarred directory | |
UNTARRED_NAME=$(tar tzf $TAR_NAME | sed -e 's,/.*,,' | uniq) | |
# Create the first "bootstrap" environment & install virtualenv | |
$PYTHON $UNTARRED_NAME/virtualenv.py $ENV_OPTS $INITIAL_ENV | |
$INITIAL_ENV/bin/pip install $TAR_NAME | |
# Don't need these anymore. | |
rm -rf $UNTARRED_NAME | |
rm -f $TAR_NAME | |
# Create a second environment from the first: | |
#$INITIAL_ENV/bin/virtualenv py-env1 | |
# Create more: | |
#$INITIAL_ENV/bin/virtualenv py-env2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment