【问题标题】:Pycharm failed to install Python packaging toolsPycharm安装Python打包工具失败
【发布时间】:2017-10-26 13:36:12
【问题描述】:

我尝试制作一个简单的 Python gui,因此我需要导入 tkinter。这个包在 Python 3 中可用,所以我需要那个解释器,但我无法在 Pycharm 中启动它。它总是要求安装打包工具,然后我每次都收到相同的错误,我似乎无法修复它。我得到以下信息:

执行的命令:

/tmp/tmpu8m14jqspycharm-management/pip-9.0.1/setup.py install

发生错误:

AttributeError: module 'setuptools.dist' has no attribute 'check_specifier'

命令输出:

    Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2237, in resolve
    return functools.reduce(getattr, self.attrs, module)
AttributeError: module 'setuptools.dist' has no attribute 'check_specifier'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/tmpu8m14jqspycharm-management/pip-9.0.1/setup.py", line 92, in <module>
    cmdclass={'test': PyTest},
  File "/usr/lib/python3.5/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 272, in __init__
    _Distribution.__init__(self,attrs)
  File "/usr/lib/python3.5/distutils/dist.py", line 281, in __init__
    self.finalize_options()
  File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 327, in finalize_options
    ep.load()(self, ep.name, value)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2229, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2239, in resolve
    raise ImportError(str(exc))
ImportError: module 'setuptools.dist' has no attribute 'check_specifier'

我已经搜索了一些修复,但没有一个真正起作用。

【问题讨论】:

标签: python-3.x pycharm ubuntu-16.04


【解决方案1】:

可能未安装 Python PIP。在基于 Debian 的发行版中:

sudo apt-get install python3-pip

如果你使用 Python 3 应该可以解决。


对于 Python 2.7x

sudo apt-get install python-pip

关闭 PyCharm 并重新打开它。

【讨论】:

    【解决方案2】:

    在这种情况下,可能没有安装 python pip(包安装程序)。所以先试试安装吧。:

    sudo apt-get install python3-pip
    

    【讨论】:

      猜你喜欢
      • 2021-08-16
      • 2016-06-24
      • 2019-01-05
      • 1970-01-01
      • 1970-01-01
      • 2019-03-14
      • 2021-10-06
      相关资源
      最近更新 更多