Skip to content

Instantly share code, notes, and snippets.

@hiroakis
Last active December 15, 2015 04:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hiroakis/5203963 to your computer and use it in GitHub Desktop.
Save hiroakis/5203963 to your computer and use it in GitHub Desktop.
My Python developing environment.
# Install pyenv in ~/.pyenv
cd ~
git clone git://github.com/yyuu/pyenv.git .pyenv
echo 'export PYENV_ROOT="${HOME}/.pyenv"' >> ~/.zshrc
echo 'if [ -d "${PYENV_ROOT}" ]; then' >> ~/.zshrc
echo ' export PATH=${PYENV_ROOT}/bin:$PATH' >> ~/.zshrc
echo ' eval "$(pyenv init -)"' >> ~/.zshrc
echo 'fi' >> ~/.zshrc
# Reload user's shell
exec $SHELL -l
# Install virtualenv as a pyenv plugin
cd $PYENV_ROOT/plugins
git clone git://github.com/yyuu/pyenv-virtualenv.git
# Lists available Python versions
pyenv install -l
# Install Python
pyenv install 2.7.3
pyenv install 3.2.3
# Sets the global version of Python to be used in all shells
pyenv gloabl 2.7.3
# Sets a local application-specific Python version
pyenv local 2.7.3
# Lists installed Python versions
pyenv versions
# Current active Python version
pyenv version
# Uninstall Python in pyenv
pyenv uninstall 3.2.3
# Create virtual Python environment "dev01" as a Python 2.7.3
pyenv virtualenv --distribute 2.7.3 dev01
# Sets dev01 environment to directory Python_2.7.3_practice
mkdir Python_2.7.3_practice
cd Python_2.7.3_practice
pyenv local dev01
# Uninstall dev01
pyenv uninstall dev01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment