Created
January 21, 2011 10:51
-
-
Save shun115/789529 to your computer and use it in GitHub Desktop.
Python : pythonbrew + 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
$ curl -kLO https://github.com/utahta/pythonbrew/raw/master/pythonbrew-install | |
$ chmod +x pythonbrew-install | |
$ ./pythonbrew-install | |
$ echo "source ~/.pythonbrew/etc/bashrc" >> .bashrc | |
$ source .bashrc | |
$ pythonbrew install -f 2.6.6 # なぜかtest_ioctlでこけたためforce | |
$ pythonbrew install -f 2.7.2 # 同上 | |
$ pythonbrew install -f 3.2.2 # 同上 | |
$ pythonbrew install 2.7.2 --configure="--with-zlib=/usr/include" | |
$ pythonbrew switch 2.7.2 | |
$ pip install virtualenv | |
$ pip install virtualenvwrapper | |
$ vi .bashrc | |
> export VIRTUALENV_USE_DISTRIBUTE=true | |
> export WORKON_HOME=~/.virtualenvs | |
> | |
> export PIP_RESPECT_VIRTUALENV=true | |
> export PIP_REQUIRE_VIRTUALENV=true | |
> export PIP_VIRTUALENV_BASE=$WORKON_HOME | |
> | |
> export VIRTUALENVWRAPPER_PYTHON=~/.pythonbrew/pythons/Python-2.7.2/bin/python | |
> source ~/.pythonbrew/pythons/Python-2.7.2/bin/virtualenvwrapper.sh | |
$ mkdir ~/.virtualenvs | |
$ source .bashrc | |
$ mkvirtualenv \ | |
--python=/home/username/.pythonbrew/pythons/Python-2.7.2/bin/python \ | |
--no-site-packages \ | |
2.7.2 | |
(2.7.2)$ deactivate | |
$ pythonbrew switch 3.2.2 | |
$ easy_install virtualenv3 | |
$ virtualenv3 \ | |
--python=~/home/username/.pythonbrew/pythons/Python-3.2.2/bin/python \ | |
--no-site-packages \ | |
$WORKON_HOME/3.2.2 | |
(3.2.2)$ deactivate | |
$ pythonbrew off | |
$ python -V | |
Python 2.6.5 | |
$ workon 2.7.2 | |
(2.7.2)$ python -V | |
Python 2.7.2 | |
(2.7.2)$ deactivate | |
$ workon 3.2.2 | |
(3.2.2)$ python -V | |
Python 3.2.2 | |
(3.2.2)$ deactivate | |
$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment