Packaging Tools
pipx
- Its goal is to install Python applications in an isolated environment.
- It is installed globally. You can't have a
pipxfor Python 3.9 and another for Python 3.10 and manage the packages in each installation separately.
Use case
I would like to install bpython using pipx. However, I need a bpython
installation for every python version. I tried to install pipx in different
python versions by using
asdf local python 3.10.6
python -m pip install pipx
asdf local python 3.9.13
python -m pip install pipx
Although I can see that pip list ran in each of the python versions would
return different list of packages (pipx included), I could only install one
version of bpython using pipx. It was like pipx could not make a difference
between the different installations of it.
bpython and IPython
For the use case above, I simply installed bpython or IPython using
python -m pip install bpython.
asdf
Manage frameworks, libraries and language versions.
We have a good motivation for using asdf in this blog post.
In particular, it explains how it replaces pyenv and several related tools.
python-launcher
Utility tool that finds the right python version to run. It is specially helpful when you are in a folder which has a .venv. With python-launcher you don't need to source the .venv all the time. python-launcher does it for you.
Info
I rather prefer to create a shell script to do the venv activation than relying on another utility tool.
Workflow
- Use
asdfto change between python versions.
# Python version in local folder or default system version
asdf local python <version>
asdf global python <version>
# Current python version being used
asdf current python <version>
- Some packages make sense to install in the venv of the python version. For example,
bpythonandipython.
pipx. That way they are completely isolated from the python venv.