Last active
April 11, 2017 10:47
-
-
Save td72/1d16b213360be2ca907efa7ecf43d9ce to your computer and use it in GitHub Desktop.
virtualenvとdirenvによるpython環境構築 ref: http://qiita.com/TD72/items/308fdb8032d2db2f042b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
layout python $(pythonz locate 3.6.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pythonz list -a # インストールできるpythonの確認 | |
$ pythonz install 3.6.0 | |
# インストールしたpythonのリスト | |
$ pythonz list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo pip install virtualenv | |
( or $ pip install --user virtualenv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir -p project | |
$ cd project | |
$ direnv edit . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment