Skip to content

Instantly share code, notes, and snippets.

@linw1995
Last active April 17, 2018 07:28
Show Gist options
  • Select an option

  • Save linw1995/1476cd51c5dfcd79818810552a4e351b to your computer and use it in GitHub Desktop.

Select an option

Save linw1995/1476cd51c5dfcd79818810552a4e351b to your computer and use it in GitHub Desktop.
Install pyenv on Ubuntu

install-dep

apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev

install

git clone https://github.com/pyenv/pyenv.git ~/.pyenv

add pyenv command into path

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.bash_profile

restart shell, then enjoiy the pyenv

exec "$SHELL"

install python env

see all versions which are able to install

pyenv install --list

pick one to install

pyenv install 3.5-dev

install it with shared libs env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.5-dev

success ouput

Cloning https://github.com/python/cpython...
Installing Python-3.5-dev...
Installed Python-3.5-dev to /home/ubuntu/.pyenv/versions/3.5-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment