close

[Solved] ImportError: cannot import name ‘sysconfig’ from ‘distutils’ (/usr/lib/python3.8/distutils/__init__.py)

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error ImportError: cannot import name ‘sysconfig’ from ‘distutils’ (/usr/lib/python3.8/distutils/init.py) in Python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How ImportError: cannot import name ‘sysconfig’ from ‘distutils’ (/usr/lib/python3.8/distutils/init.py) Error Occurs?

Today I get the following error ImportError: cannot import name ‘sysconfig’ from ‘distutils’ (/usr/lib/python3.8/distutils/init.py) in Python.

How To Solve ImportError: cannot import name ‘sysconfig’ from ‘distutils’ (/usr/lib/python3.8/distutils/init.py) Error ?

  1. How To Solve ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/init.py) Error ?

    To Solve ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/init.py) Error 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.

Solution 1

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.

Solution 2


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

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment