Skip to content

Instantly share code, notes, and snippets.

@clwyatt
Last active December 12, 2015 11:19
Show Gist options
  • Save clwyatt/4765329 to your computer and use it in GitHub Desktop.
Save clwyatt/4765329 to your computer and use it in GitHub Desktop.
Python development environment setup using virtualenv
import virtualenv, textwrap
output = virtualenv.create_bootstrap_script(textwrap.dedent("""
from os.path import join
from os import getcwd
from subprocess import call
def after_install(options, home_dir):
pip = join(getcwd(), home_dir, 'bin', 'pip')
easy = join(getcwd(), home_dir, 'bin', 'easy_install')
call([pip, 'install', 'numpy'])
call([pip, 'install', 'nibabel'])
call([easy, 'lxml'])
call([easy, 'httplib2'])
call([pip, 'install', 'pyxnat'])
"""))
f = open('devenv-bootstrap.py', 'w').write(output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment