Last active
February 16, 2023 09:29
-
-
Save jmvrbanac/8793985 to your computer and use it in GitHub Desktop.
Install pyenv 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
#!/bin/bash | |
sudo apt-get install git python-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl | |
sudo pip install virtualenvwrapper | |
git clone https://github.com/yyuu/pyenv.git ~/.pyenv | |
git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc | |
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(pyenv init -)"' >> ~/.bashrc | |
echo 'pyenv virtualenvwrapper' >> ~/.bashrc | |
exec $SHELL |
Really thanks!!!!!!!!
In Ubuntu 20.04
, it's now python3-pip
and the command sudo pip install virtualenvwrapper
becomes sudo pip3 install virtualenvwrapper
I am using Ubuntu 20.10 and I had to install python-is-python3
to obtain a proper installation.
sudo apt-get install python-is-python3
Otherwise, the procedure worked like a charm.
Thanks!!
You can also follow this to install pyenv https://reshukumari120.medium.com/installing-pyenv-in-ubuntu-967fd05bf959 Thanks.
Thanks @BernardLeclerc, your suggestion works for me as well for Ubuntu 21.10
Instead of,
echo 'pyenv virtualenvwrapper' >> ~/.bashrc
Use
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
Adding virtualenv plugin installation in addition. Thanks for the gist
Updated version: https://gist.github.com/styk-tv/b160cd2e4a54472ba04a17f11b7faca5
How is pyenv not an apt-get package I can install with one command??
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add
libffi-dev
in the dependencies as pointed out in this SO post:https://stackoverflow.com/questions/52868280/pyenv-fails-with-modulenotfounderror-no-module-named-ctypes-error