'Python3.8 Pip Distutils.cmd Not Found

I was trying to have a virtualenv set up where it is at python 3.8 while my system is at a more recent version.

I have figured out how to create the venv but now when I try to install packages like mediapipe and opencv-python and everything else I get an error saying: ModuleNotFoundError: No module named 'distutils.cmd'. I have tried sudo apt-get install python-distutils and sudo apt-get install python-apt but they are all up to date and do nothing.

I am on Debian Bullseye (the raspberry pi one though)

Thanks

(P.S Sorry if this is a duplicate but nothing else worked)



Solution 1:[1]

I got the same issue, what resolved it was to install distutils for python3.8 specfically with

sudo apt install python3.8-distutils

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Iliya