I had been using Python 3.8 for a while and recently updated to 3.10. I made a link for /usr/bin to point to the new version and in general things worked fine, until I tried to use a module I had installed via pip a few weeks ago. I noticed that if I ran python3.8 thescript.py, it worked fine.
I guessed that, for whatever reason, the global modules installed via pip weren't available to Python 3.10. I just reinstalled them but, as I did, I noticed it wasn't installing because it already existed:
Requirement already satisfied: pdfservices-sdk in ./.local/lib/python3.8/site-packages (1.0.1)
There's a lot more output, but note it's finding it in 3.8. I tried uninstalling pip and reinstalling it, thinking it would know my current version of Python and use a new directory, but that didn't work.
I also noticed that if I run: python -m pip, I get an error:
ModuleNotFoundError: No module named 'distutils.util'
But I can do python3.8 -m pip. So my pip install is still using 3.8, which I can confirm with pip --version.
How do I get pip working with python3.10 again?
I fixed the distutils.util issue by doing sudo apt-get install --reinstall python3.10-distutils. I can now run python -m pip. But I still have the same issue where when I install, it's doing it to 3.8.
** Another Edit ** I had installed pip via sudo apt-get install python3-pip. I know the pip had a script for installing, but that had failed for me. Following a suggestion here, https://github.com/deadsnakes/issues/issues/184, I tried python get-pip.py --user, it worked, and I do see pip is now a newer version. When I pip freeze, I do NOT see the library I was trying to install. I assumed all was well then, but when installing my module (pdfservices-sdk), and it worked for a bit... and then failed on cffi. Partial screen shot:
