Last active
October 18, 2022 18:47
-
-
Save 0xnu/067d06e0fc4e40a800c154b05adce157 to your computer and use it in GitHub Desktop.
Install Pyenv on Amazon Linux 2
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
### prerequisites | |
sudo yum -y update | |
sudo yum -y install git tmux | |
sudo yum -y install @development zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel xz xz-devel libffi-devel findutils | |
### install `pyenv` | |
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash | |
export PYENV_ROOT="$HOME/.pyenv" | |
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" | |
eval "$(pyenv init -)" | |
eval "$(pyenv virtualenv-init -)" | |
### restart SHELL and install `python` | |
echo $PATH | |
echo $(pyenv root) | |
pyenv install --list | |
pyenv install 3.10.5 | |
pyenv versions | |
### install `pyenv virtualenv` | |
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv | |
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile | |
### restart SHELL and virtualenv | |
pyenv virtualenv 3.10.5 test-3.10.5 | |
pyenv virtualenvs | |
pyenv local test-3.10.5 | |
pyenv version | |
cat .python-version #> test-3.10.5 | |
pyenv rehash | |
python --version #> Python 3.10.5 | |
pip3 list --format=columns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment