Last active
March 17, 2023 02:28
-
-
Save shdennlin/03e36d1d922d0ad44f6cace0960f1b42 to your computer and use it in GitHub Desktop.
pyenv + pyenv-virtualenv + pyenv-virtualenvwrapper on Ubuntu
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
# ubuntu | |
sudo apt update; sudo apt install build-essential libssl-dev zlib1g-dev \ | |
libbz2-dev libreadline-dev libsqlite3-dev curl \ | |
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev | |
# install pyenv | |
git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
F="$HOME/.profile" | |
echo "#pyenv" >> $F | |
echo "export PYENV_ROOT=\"\$HOME/.pyenv\"" >> $F | |
echo "command -v pyenv >/dev/null || export PATH=\"\$PYENV_ROOT/bin:\$PATH\"" >> $F | |
echo "eval \"\$(pyenv init -)\"" >> $F | |
source $F | |
pyenv install python 3.10.10 | |
pyenv global 3.10.10 | |
# install pyenv-virtualenv, pyenv-virtualenvwrapper | |
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv | |
git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper | |
F="$HOME/.profile" | |
echo "eval \"\$(pyenv virtualenv-init -)\"" >> $F | |
echo "pyenv virtualenvwrapper_lazy" >> $F |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment