Pip 在 Archlinux 上安装无法构建 egg

Pip 在 Archlinux 上安装无法构建 egg

我尝试在 Archlinux 服务器上安装 nltk,但安装失败,并输出以下错误


/usr/lib/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'entry_points'

  warnings.warn(msg)

/usr/lib/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'zip_safe'

  warnings.warn(msg)

/usr/lib/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'test_suite'

  warnings.warn(msg)

usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

   or: setup.py --help [cmd1 cmd2 ...]

   or: setup.py --help-commands

   or: setup.py cmd --help



error: invalid command 'bdist_egg'

/tmp/pip_build_root/nltk/distribute-0.6.21-py3.3.egg

Traceback (most recent call last):

  File "./distribute_setup.py", line 143, in use_setuptools

    raise ImportError

ImportError



During handling of the above exception, another exception occurred:



Traceback (most recent call last):

  File "", line 16, in 

  File "/tmp/pip_build_root/nltk/setup.py", line 23, in 

    distribute_setup.use_setuptools()

  File "./distribute_setup.py", line 145, in use_setuptools

    return _do_download(version, download_base, to_dir, download_delay)

  File "./distribute_setup.py", line 125, in _do_download

    _build_egg(egg, tarball, to_dir)

  File "./distribute_setup.py", line 116, in _build_egg

    raise IOError('Could not build the egg.')

OSError: Could not build the egg.

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/nltk
Storing complete log in /root/.pip/pip.log

matplotlib 也会出现此错误,但这是我迄今为止发现的唯一一个失败的其他库。pyyaml 安装正常。安装在我的 Mac 上的 virtualenv 下完美运行,它使用 python 2.7,但服务器使用 python 3.3。任何帮助都非常感谢。

答案1

我在 Linux Mint Quiana 17 64 位上也遇到了同样的问题。我不知道为什么,但当我运行

sudo pip install nltk

它安装了 nltk 2.0.4,如 所示pip list。这可能会导致此问题,因为 nltk 3.0 是第一个支持 Python 3 的版本。此外,运行pip search nltk确实显示 nltk 的最新版本是 3.0.0b2(截至撰写本文时,它是),但运行sudo pip install -U nltksudo pip install -U nltk==3.0.0b2安装最新版本都没有。也许是因为我不太了解 pip,或者我的 google-fu 不够强,但我无法让它安装最新版本。

我的解决方法是克隆github 存储库nltk 3.0.0b2 并自行运行setup.py。

相关内容