Manage Python multiple version environment with Pythonz, virtualenv

Build version control with Pythonz and virtual environment with virtualenv

virtualenv, wrapper environment settings

install

$ sudo pip install virtualenv virtualenvwrapper

Virtualenv setting in .zshrc

When the virtualenv environment is ~ / .virtualenvs

## virtualenv, virtualenvwrapper
which virtualenvwrapper.sh > /dev/null
if [ $? -eq 0 ]; then
    source `which virtualenvwrapper.sh`
    mkdir -p ~/.virtualenvs
    export WORKON_HOME=~/.virtualenvs
    export PIP_RESPECT_VIRTUALENV=true
fi

Pythonz preferences

install

$ curl -kL https://raw.github.com/saghul/pythonz/master/pythonz-install | bash

Pythonz settings in .zshrc

# Pythonz
if [ -s $HOME/.pythonz/etc/bashrc ]; then
    source $HOME/.pythonz/etc/bashrc
fi

Multiple Python version install

$ pythonz install 2.7.5
$ pythonz install 2.6.9
$ pythonz install 3.3.3

#Verification
$ pythonz list

==>
  CPython-2.6.9
  CPython-2.7.5
  CPython-3.3.3

Pythonz + virtualenv

Create virtual environment

$ mkvirtualenv -p ~/.pythonz/pythons/CPython-2.6.9/bin/python2.6 v2.6.9 && deactivate

$ mkvirtualenv -p ~/.pythonz/pythons/CPython-2.7.5/bin/python2.7 v2.7.5 && deactivate

$ mkvirtualenv -p ~/.pythonz/pythons/CPython-3.3.3/bin/python3.3 v3.3.3 && deactivate

Switch environment & delete

# activate
$ workon v2.7.5

# deactivate (to System)
$ deactivate

# remove
$ rmvirtualenv v2.6.9

[reference] -Virtualenvwrapper command reference http://virtualenvwrapper-docs-ja.readthedocs.org/en/latest/command_ref.html

Recommended Posts

Manage Python multiple version environment with Pythonz, virtualenv
Manage python environment with virtualenv
Clean python environment with pythonz and virtualenv
Specify python version with virtualenv
Build python virtual environment with virtualenv
Manage each Python version with Homebrew
Build Python development environment (pythonz, virtualenv, direnv)
Manage multiple Python versions with update-alternatives (Ubuntu)
Use multiple versions of python environment with pyenv
Python environment with docker-compose
Commands for creating a python3 environment with virtualenv
Work in a virtual environment with Python virtualenv.
Manage multiple context managers together with Python contextlib.ExitStack
Virtual environment with Python 3.6
Check version with python
Build a python virtual environment with virtualenv and virtualenvwrapper
Manage Python runtime packages and development environment packages with Poetry
Manage cron jobs with python
Create an environment with virtualenv
Install Python environment with Anaconda
Build python3 environment with ubuntu 16.04
Prepare python3 environment with Docker
Build python environment with direnv
Prepare Python development environment with Mac + Windows + VisualStudio Code (Windows version)
Prepare Python development environment with Mac + Windows + VisualStudio Code (Mac version)
Virtual Environment Version Control Summary Python
[Package cloud] Manage python packages with package cloud
Setup modern Python environment with Homebrew
Build Mysql + Python environment with docker
Create a virtual environment with Python!
pyenv-change the python version of virtualenv
Building a virtual environment with Python 3
Use rospy with virtualenv in Python3
Post multiple Twitter images with python
Animate multiple still images with Python
Python3 environment construction with pyenv-virtualenv (CentOS 7.3)
Multiple integrals with Python and Sympy
pytorch @ python3.8 environment construction with pipenv
Prepare Python development environment with Atom
[Python] Creating multiple windows with Tkinter
When using MeCab with virtualenv python
[Python Windows] pip install with Python version
Create another version of Python conda environment with one command line
[Pyenv] Building a python environment with ubuntu 16.04
[Ubuntu 18.04] Python environment construction with pyenv + pipenv
[Python] Building an environment with Anaconda [Mac]
Competitive programming with python Local environment settings
Change Python 64bit environment to 32bit environment with Anaconda
Building a Python3 environment with Amazon Linux2
Build Jupyter Lab (Python) environment with Docker
[Development environment] Python with Xcode [With screen transition]
Use smbus with python3 under pyenv environment
About the virtual environment of python version 3.7
[Python] Create a virtual environment with Anaconda
Building a Python 3.6 environment with Windows + PowerShell
Create Python + uWSGI + Nginx environment with Docker
Create a virtual environment with Python_Mac version
Process multiple lists with for in Python
Build Python environment with Anaconda on Mac
Python virtual environment construction (2017 version) pyenv and pyenv-virtualenv and virtualenv and virtualenv wrapper and pyvenv and venv
Install Python3 using pythonz under macports environment