When I try to add virtualenv as an interpreter in PyCharm Community 2018.1.2 in Kubuntu 18.04 I get the following error:
ModuleNotFoundError: No module named 'distutils.core'
How can I solve this?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
I had to install it. This was fresh Kubuntu 18.04 install, obviously, without this needed package.
sudo apt-get install python3-distutils
After that I restarted PyCharm and creating virtual project interpreter was successful.
If @Hrvoje T's answer did not work (it did not work for me) then try this:
Run this command and you should be able to install the packaging tools in Pycharm:
sudo apt install python3-pip
python-pip if you are using the Python3 interpreter.
Actually, @hyukkyulee solution solved the issue.
It is because, by default, Ubuntu comes with python 2.7 and python 3.x version. And if you have installed pip using
sudo apt install python-pip
will install 'pip' in python 2.7 folder.
so you need to specify python3-pip to install pip in python 3 folder along with other util packages.