python – ModuleNotFoundError: No module named 'distutils.core'-ThrowExceptions

Exception or error:

I’ve recently upgraded from Ubuntu 18.04 to 19.04 which has python 3.7. But I work on many projects using Python 3.6.

Now when I try to create a virtualenv with Python 36 in PyCharm, it raises:

ModuleNotFoundError: No module named 'distutils.core'

enter image description here

I can’t figure out what to do.

I tried to install distutils:

milano@milano-PC:~$ sudo apt-get install python3-distutils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-distutils is already the newest version (3.7.3-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

But as you can see I have the newest version.

Do you know what to do?

How to solve:

Python base interpreter does require some additiional modules. Those are not installed with 18.04 as default.
To solve the missing packages problem run the following and restart pycharm afterwards

sudo apt-get install python3-distutils

refer to this article

Leave a Reply

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