Hello World from OSS Silicon Valley
HowToUse/Pyenv/1.0
_ Prerequisite
- Ubuntu server installation (You cn refer HowToUse/UbuntuServer/14.04)
- Python installation (You can refer HowToUse/Python/2.7)
_ Install&Setup
- Step.1
- Download pyenv from Github.
$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv
- Step.2
- Edit .bash_profile
export PYENV_ROOT=$HOME/.pyenv export PATH=$PYENV_ROOT/bin:$PATH eval "$(pyenv init -)"
- Step.3
- Load .bash_profile
$ source ~/.bash_profile
- Step.4
- Install necessary modules to compile python.
$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils
_ HowToUse
_ Switch the Python
- Step.1
- Check the installed python's version
$ pyenv versions
- Step.2
- Check what modules you can install additionally.
$ pyenv install --list
- Step.3
- Install modules.
$ pyenv install 3.0.1
- Step.4
- Switch python versions for the local project.
$ pyenv local 3.0.1
Then your python should be switched to 3.0.1.
_ Recompile Python
- Step.1
- Sometimes, python's process might be failed due to the lack of required library. In that case, you need to recompile the python after you install necessary module.
$ CFLAGS="-fPIC"pyenv install <version>
_ Author
S.Yatsuzuka
[ back ]
Last-modified: 2016-12-13 (Tue) 07:25:08 (2992d)