ModuleNotFoundError:没有名为'distutils.core'的模块

问题描述 投票:3回答:1

我最近从Ubuntu 18.04升级到有19.04python 3.7。但我使用Python 3.6处理许多项目。

现在,当我尝试在PyCharm中使用virtualenv创建Python 36时,它会引发:

ModuleNotFoundError: No module named 'distutils.core'

enter image description here

我无法弄清楚该怎么做。

我试图安装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.

但是你可以看到我有最新的版本。

你知道该怎么办吗?

python pycharm virtualenv python-3.6
1个回答
4
投票

Python基本解释器确实需要一些附加模块。这些默认情况下不安装18.04。要解决丢失的包问题,请运行以下命令并在之后重新启动pycharm

sudo apt-get install python3-distutils

refer to this article

© www.soinside.com 2019 - 2024. All rights reserved.