Python错误-“ ImportError:无法导入名称'dist'”

我在Ubuntu 16.04上,我得到:


Traceback (most recent call last):

  File "/home/omermazig/.virtualenvs/fixi/bin/pip", line 7, in <module>

    from pip import main

  File "/home/omermazig/.virtualenvs/fixi/lib/python3.6/site-packages/pip/__init__.py", line 26, in <module>

    from pip.utils import get_installed_distributions, get_prog

  File "/home/omermazig/.virtualenvs/fixi/lib/python3.6/site-packages/pip/utils/__init__.py", line 23, in <module>

    from pip.locations import (

  File "/home/omermazig/.virtualenvs/fixi/lib/python3.6/site-packages/pip/locations.py", line 9, in <module>

    from distutils import sysconfig

  File "/home/omermazig/.virtualenvs/fixi/lib/python3.6/distutils/__init__.py", line 25, in <module>

    from distutils import dist, sysconfig

ImportError: cannot import name 'dist'

当我用python运行任何东西时。这专门用于尝试运行“点冻结”。该怎么办?


明月笑刀无情
浏览 492回答 3
3回答

翻翻过去那场雪

尝试一下sudo&nbsp;apt&nbsp;install&nbsp;python3-distutils

森林海

我的情况是当我升级Ubuntu 18-> 19时。因此它重新安装了python,而我需要做的是:删除旧的虚拟环境创建一个新的通过pip安装要求
打开App,查看更多内容
随时随地看视频慕课网APP