Prerequisites for pyenv
sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
Troubleshooting guide here.
`curl https://pyenv.run | bash
Open .bashrc
and add the following lines to the end:
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
exec $SHELL
Test that things work:
pyenv --version
Install python pyenv install 3.9.15
Latest version can be found here.
Set the global interpreter: pyenv global 3.9.15
Check the global python version: which python
It should read: /home/josh/.pyenv/shims/python
pipx is a tool to help you install and run end-user applications written in Python. It's roughly similar to macOS's brew, JavaScript's npx, and Linux's apt.
It's closely related to pip. In fact, it uses pip, but is focused on installing and managing Python packages that can be run from the command line directly as applications.
pip is a general-purpose package installer for both libraries and apps with no environment isolation. pipx is made specifically for application installation, as it adds isolation yet still makes the apps available in your shell: pipx creates an isolated environment for each application and its associated packages.
pipx does not ship with pip, but installing it is often an important part of bootstrapping your system.
python3 -m pip install --user pipx
python3 -m pipx ensurepath
Upgrade pipx using: python3 -m pip install --user -U pipx
curl -sSL https://install.python-poetry.org | python3 -
Guide here.