Skip to content

Instantly share code, notes, and snippets.

@nnsnodnb
Last active April 17, 2020 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nnsnodnb/6e47e8ea55ac4c427ef94068760d04d1 to your computer and use it in GitHub Desktop.
Save nnsnodnb/6e47e8ea55ac4c427ef94068760d04d1 to your computer and use it in GitHub Desktop.
#!/bin/bash -eu
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y git build-essential libffi-dev libssl-dev zlib1g-dev liblzma-dev libbz2-dev libreadline-dev libsqlite3-dev
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
source ~/.bashrc
read -p "Enter Python version: " PYTHON_VERSION
pyenv install $PYTHON_VERSION
pyenv rehash
pyenv global $PYTHON_VERSION
pip install -U pip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment