【问题标题】:What is the under lying issue for "python setup.py egg_info" and is there a universal fix?“python setup.py egg_info”的潜在问题是什么,是否有通用修复?
【发布时间】:2017-11-19 13:19:01
【问题描述】:

尝试在 Ubuntu 16.04 LTS 上安装某些 Python 软件包时出现以下错误。我已经用谷歌搜索了修复,但到目前为止没有一个有效,而且似乎都非常特定于特定的包。有没有通用的解决方法,有人可以向我解释一下根本问题是什么吗?

命令“python setup.py egg_info”失败,错误代码为 1 /tmp/pip-build-9w8mswlw/tsne/

最近一次发生在我运行pip3 install tsne

输出如下

Collecting tsne
  Using cached tsne-0.1.7.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-9w8mswlw/tsne/setup.py", line 18, in <module>
        from Cython.Distutils import build_ext
    ImportError: No module named 'Cython'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-9w8mswlw/tsne/

【问题讨论】:

  • 修复方法是安装 Cython。
  • 你确实有一个回溯给你:ImportError: No module named 'Cython'.
  • 通用修复方法是在“命令失败”消息之前读取回溯并修复导致该问题的任何原因。
  • @jwodder:这需要你知道 Cython 是什么。该项目应该使 Cython 成为 setup_requirements 依赖项,遵循advice in this answer
  • 谢谢大家!安装 Cython 用于删除“python setup.py egg_info”,现在出现另一个错误但不相关。下次会更加注意错误。再次感谢

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


【解决方案1】:

您需要安装Cython language compiler。这列在project page

Barnes-Hut-SNE aka fast-tsne 的 python (cython) 包装器。

要求

  • numpy > =1.7.1
  • scipy >= 0.12.0
  • cython >= 0.19.1
  • cblas 或 openblas。测试版本为 v0.2.5 和 v0.2.6(OSX 不需要)。

您可以使用安装 Cython

pip install Cython

虽然tsne 项目执行list Cython as a setuptools requirement,但不幸的是,他们没有将其列为设置要求,并假设它已经预先安装。

我提交了bug report with that project;将来点项目到setup_requires with Cython?,以便pip install project_depending_on_cython在安装时自动拉入Cython。

【讨论】:

    猜你喜欢
    • 2017-09-30
    • 1970-01-01
    • 1970-01-01
    • 2018-07-02
    • 2015-08-30
    • 2022-06-25
    • 2010-12-01
    • 2015-05-01
    相关资源
    最近更新 更多