For those interested, here is a script that first checks if the respective python module exists as apt, and uses pip install only as last resort. It strives to look also recursively, to identify anything that can be installed as apt install, and use pip3 install only when needed. Note: it always uses the last versions only, and does not install the development dependencies (it's mainly for runtime use-case, but could be expanded by PR :). https://github.com/ReSearchITEng/aptpip/