【问题标题】:Python - pip install pyublas : Could Not Build The EggPython - pip install pyublas:无法构建鸡蛋
【发布时间】:2015-07-26 09:06:53
【问题描述】:

我在 Ubuntu 14.04 上通过 pip 安装 PyUblas 时遇到问题。 我正在使用 Python 2.7.6。

这是日志:

Traceback (most recent call last):
  File "setup.py", line 248, in <module>
    scripts = scripts,
  File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
    _setup_distribution = dist = klass(attrs)
  File "/tmp/tmpJjyKIr/distribute-0.6.35/setuptools/dist.py", line 225, in __init__
    _Distribution.__init__(self,attrs)
  File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "/tmp/tmpJjyKIr/distribute-0.6.35/setuptools/dist.py", line 257, in finalize_options
    ep.require(installer=self.fetch_build_egg)
  File "/tmp/tmpJjyKIr/distribute-0.6.35/pkg_resources.py", line 2027, in require
    working_set.resolve(self.dist.requires(self.extras),env,installer))
  File "/tmp/tmpJjyKIr/distribute-0.6.35/pkg_resources.py", line 2237, in requires
    dm = self._dep_map
  File "/tmp/tmpJjyKIr/distribute-0.6.35/pkg_resources.py", line 2466, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/tmp/tmpJjyKIr/distribute-0.6.35/pkg_resources.py", line 2499, in _compute_dependencies
    common = frozenset(reqs_for_extra(None))
  File "/tmp/tmpJjyKIr/distribute-0.6.35/pkg_resources.py", line 2496, in reqs_for_extra
    if req.marker_fn(override={'extra':extra}):
  File "/tmp/tmpJjyKIr/distribute-0.6.35/_markerlib/markers.py", line 109, in marker_fn
    return eval(compiled_marker, environment)
  File "<environment marker>", line 1, in <module>
NameError: name 'sys_platform' is not defined
/tmp/pip_build_alain/pyublas/distribute-0.6.35-py2.7.egg
Traceback (most recent call last):
  File "<string>", line 17, in <module>
  File "/tmp/pip_build_alain/pyublas/setup.py", line 143, in <module>
    main()
  File "/tmp/pip_build_alain/pyublas/setup.py", line 29, in main
    from aksetup_helper import hack_distutils, get_config, setup, \
  File "aksetup_helper.py", line 3, in <module>
    distribute_setup.use_setuptools()
  File "distribute_setup.py", line 152, in use_setuptools
    return _do_download(version, download_base, to_dir, download_delay)
  File "distribute_setup.py", line 132, in _do_download
    _build_egg(egg, tarball, to_dir)
  File "distribute_setup.py", line 123, in _build_egg
    raise IOError('Could not build the egg.')
IOError: Could not build the egg.

有没有人知道这里的问题可能是什么? 提前致谢。

【问题讨论】:

  • 这个运气好吗?遇到同样的问题。

标签: python pip egg


【解决方案1】:

我间歇性地遇到了这个问题。这是一个对我有用的(完全hacky)修复。首先,下载 PyUblas 源码:

pip install pyublas -d .
tar xvfz PyUblas-2013.1.tar.gz
cd PyUblas-2013.1/

然后编辑aksetup_helper.py 并注释掉导致它使用自己的自定义版本分发的行:

# dealings with ez_setup ------------------------------------------------------
# COMMENT OUT THE NEXT TWO LINES
# import distribute_setup
# distribute_setup.use_setuptools()

import setuptools
from setuptools import Extension

最后只需要手动安装:

python setup.py install

您的里程可能会有所不同。 :-)

编辑:您也可以直接删除它尝试导入的distribute_setup 模块:echo "def use_setuptools(): pass" &gt; distribute_setup.py,而不是手动编辑文件。如果您尝试编写该过程的脚本,这可能会更容易。

【讨论】:

    猜你喜欢
    • 2013-07-11
    • 1970-01-01
    • 2019-12-04
    • 2013-12-26
    • 1970-01-01
    • 2013-02-23
    • 2017-03-08
    • 2016-03-03
    • 2012-03-11
    相关资源
    最近更新 更多