Developed and verified with multiple python versions with direnv

Positioning

Almost as a reference. I wrote it for myself so that I can use it by copying it for the time being.

direnv, pythonz, virtualenv, etc.

Installation

####### install packages
sudo apt-get -y install build-essential zlib1g-dev libbz2-dev libssl-dev libreadline-dev libncurses5-dev libsqlite3-dev libgdbm-dev libdb-dev libexpat-dev libpcap-dev liblzma-dev libpcre3-dev curl python-pip

####### install pythonz
curl -kL https://raw.github.com/saghul/pythonz/master/pythonz-install | bash
echo '[[ -s $HOME/.pythonz/etc/bashrc ]] && source $HOME/.pythonz/etc/bashrc' >> $HOME/.bashrc
source ~/.bashrc

####### install virtualenv
sudo pip install virtualenv

####### install direnv
curl -L -o direnv https://github.com/zimbatm/direnv/releases/download/v2.5.0/direnv.linux-amd64
sudo install direnv /usr/local/bin
echo 'type direnv > /dev/null 2>&1 && eval "$(direnv hook bash)" ' >> $HOME/.bashrc

Install the python you want

pythonz list -a
# Available Python versions
  # cpython:
     2.4
     2.4.1
     2.4.2
     2.4.3
     2.4.4
     2.4.5
     2.4.6
     2.5
     2.5.1
     2.5.2
     2.5.3
The following is omitted

Install like this

pythonz install 3.4.0

python version setting

Do the following in the path you want to develop

cd /PATH/TO/YOUR/PYTHON/PATH
echo 'layout python $(pythonz locate 3.4.0)' > .envrc
direnv allow

Version change

Modify .envrc to direnv allow

Package installation

A pip list will show that it contains only the local packages for that version.

pip install ???

Install with

References

http://qiita.com/jnotoya/items/ca9a0dfee6b9f084f4da

Recommended Posts

Developed and verified with multiple python versions with direnv
Multiple integrals with Python and Sympy
Manage multiple Python versions with update-alternatives (Ubuntu)
Building a python environment with virtualenv and direnv
Programming with Python and Tkinter
Encryption and decryption with Python
Python and hardware-Using RS232C with Python-
Install multiple versions of Python
Build python environment with direnv
python with pyenv and venv
Works with Python and R
Notes on deploying pyenv with Homebrew and managing Python versions
Communicate with FX-5204PS with Python and PyUSB
Shining life with Python and OpenCV
Install Python 2.7.9 and Python 3.4.x with pip.
Neural network with OpenCV 3 and Python 3
AM modulation and demodulation with python
[Python] font family and font with matplotlib
Scraping with Node, Ruby and Python
Scraping with Python and Beautiful Soup
JSON encoding and decoding with python
Hadoop introduction and MapReduce with Python
[GUI with Python] PyQt5-Drag and drop-
Post multiple Twitter images with python
Reading and writing NetCDF with Python
Animate multiple still images with Python
I played with PyQt5 and Python3
Reading and writing CSV with Python
Coexistence of Python2 and 3 with CircleCI (1.0)
Easy modeling with Blender and Python
[Python] Creating multiple windows with Tkinter
Sugoroku game and addition game with python
FM modulation and demodulation with Python
Build and test a CI environment for multiple versions of Python
Handle multiple python versions in one jupyter
Communicate between Elixir and Python with gRPC
Data pipeline construction with Python and Luigi
Calculate and display standard weight with python
Monitor Mojo outages with Python and Skype
FM modulation and demodulation with Python Part 3
[Automation] Manipulate mouse and keyboard with Python
Passwordless authentication with RDS and IAM (Python)
Python installation and package management with pip
What to do if ipython and python start up with different versions
Using Python and MeCab with Azure Databricks
POST variously with Python and receive with Flask
Capturing images with Pupil, python and OpenCV
Fractal to make and play with Python
A memo with Python2.7 and Python3 on CentOS
Use PIL and Pillow with Cygwin Python
Create and decrypt Caesar cipher with python
CentOS 6.4 with Python 2.7.3 with Apache with mod_wsgi and Django
Reading and writing JSON files with Python
Dealing with "years and months" in Python
Process multiple lists with for in Python
I installed and used Numba with Python3.5
Tweet analysis with Python, Mecab and CaboCha
Linking python and JavaScript with jupyter notebook
Traffic monitoring with Kibana, ElasticSearch and Python
FM modulation and demodulation with Python Part 2
Question: Multiple integrals with python don't work