[Django]-ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/__init__.py)

75👍

I have tried recently manually installing python3.9 version in my Ubuntu from 3.6 version using apt install python3.9. Then pip3 was broken. The issue is because distutils were not build for the 3.9 version.

So in my case I ran apt install python3.9-distutils to resolve my issue.

In your case make sure to modify 3.x version in distutils command.

17👍

This helped but then I got another error: ImportError: No module named ‘pip._internal’

The following fixed it:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

python3 get-pip.py –force-reinstall

Leave a comment