Pycharm无法安装Python打包工具

时间:2017-05-25 19:24:48

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

我尝试制作一个简单的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'

我已经搜索了一些修复但没有实际工作。

2 个答案:

答案 0 :(得分:2)

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

sudo apt-get install python3-pip

应该解决您是否使用PYTHON 3的问题。 对于PYTHON 2.7X

sudo apt-get install python-pip

关闭pyCharm并重新打开。

答案 1 :(得分:-1)

在这种情况下,可能未安装python pip(软件包安装程序)。因此,请尝试先安装它。

Convert.ToInt64