Created
June 13, 2018 20:44
-
-
Save mrthomaskim/e48d747816cfac0b481684e7a5084e48 to your computer and use it in GitHub Desktop.
Amazon Linux AMI, pyenv, virtualenv, Python, ... Hello, World!
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 groupinstall "Development Tools" | |
git --version | |
gcc --version | |
bash --version | |
python --version # (system) | |
sudo yum install -y openssl-devel readline-devel zlib-devel | |
sudo yum update | |
### install `pyenv` | |
git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
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 and install `python` | |
echo $PATH | |
echo $(pyenv root) | |
pyenv install --list | |
pyenv install 3.6.3 | |
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.6.3 test-3.6.3 | |
pyenv virtualenvs | |
pyenv local test-3.6.3 | |
pyenv version | |
cat .python-version #> test-3.6.3 | |
pyenv rehash | |
python --version #> Python 3.6.3 | |
pip list --format=columns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was very helpful! Just wanted to note that I also needed to use
. .bash_profile
from~/.
directory for the changes to stick (within ### restart SHELL and install `python`).