AttributeError: module ‘pkgutil’ has no attribute ‘ImpImporter’. Did you mean: ‘zipimporter’?


Due to the removal of the long-deprecated pkgutil.ImpImporter class, the pip command may not work for Python 3.12.

You just have to manually install pip for Python 3.12

python -m ensurepip --upgrade
python -m pip install --upgrade setuptools
python -m pip install <module>

with the module.. for example: instead of pip install opencv-python, use: python -m pip install opencv-python

Leave a Reply

Your email address will not be published. Required fields are marked *