Make python version control and build a virtual environment as easy as possible without using the system python.
$ 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
$ exec $SHELL
$ pythonz list -a #Checking which python can be installed
$ pythonz install 3.6.0
#List of installed python
$ pythonz list
Only then you have to use the system python
$ sudo pip install virtualenv
( or $ pip install --user virtualenv)
$ mkdir -p $HOME/.virtualenvs
$ virtualenv -p $HOME/.pythonz/pythons/CPython-3.6.0/bin/python $HOME/.virtualenvs/default
$ echo ". $HOME/.virtualenvs/default/bin/activate" >> $HOME/.zshrc
$ exec $SHELL
Premise that go is installed
$ go get github.com/direnv/direnv
$ cd $GOPATH/src/github.com/dirnev/direnv
$ go install
$ echo 'type direnv > /dev/null 2>&1 && eval "$(direnv hook bash)" ' >> $HOME/.zshrc
$ mkdir -p project
$ cd project
$ direnv edit .
..envrc
layout python $(pythonz locate 3.6.0)
Building a Python development environment (pythonz, virtualenv, direnv)
Recommended Posts