如何修复“ ModuleNotFoundError:没有名为'setuptools'的模块”

时间:2019-04-30 15:08:28

标签: ubuntu pycharm python-3.6 setuptools

我在PyCharm和解释器的设置中创建了一个新项目,我看到了以下消息:“找不到python打包工具”。当我点击“安装打包工具”时收到此错误

Traceback (most recent call last):
  File "/tmp/tmp_mwyd_zhpycharm-management/pip-19.0.3/setup.py", line 6, in <module>
    from setuptools import find_packages, setup
ModuleNotFoundError: No module named 'setuptools'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "/tmp/tmp_mwyd_zhpycharm-management/pip-19.0.3/setup.py", line 6, in <module>
    from setuptools import find_packages, setup
ModuleNotFoundError: No module named 'setuptools'

我尝试过:sudo apt-get更新,sudo apt-get升级,sudo apt-get install python-setuptools都无济于事。

1 个答案:

答案 0 :(得分:0)

setuptools 是一个python软件包,您可以使用 pip

进行安装
pip install setuptools