How To Python3 Ubuntu 20.04 Using ASDF
Published on 26 November 2020 12:00 AM
- Git clone the ASDF repo
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.0
- Add the following line to your ZSH config file
~/.zshrc
. $HOME/.asdf/asdf.sh
- Restart ZSH config
source ~/.zshrc
- Install ASDF plugins
asdf plugin add python
- Install Dependencies for Python
sudo apt-get update; sudo apt-get install -y --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
- A common request for Python is being able to use the python2 and python3 commands without needing to switch version. This can be achieved by setting multiple versions of Python, for example with Install Python3 and Python2 manage versions
asdf install python 3.9.0
asdf install python 2.7.13
asdf global python 3.9.0 2.7.13
asdf reshim
python --version
python2 --version