【问题标题】:Anaconda failed building wheel for faulthandler on TravisCI for python 2.7Anaconda 在 TravisCI for python 2.7 上为故障处理程序构建轮子失败
【发布时间】:2018-03-10 10:54:08
【问题描述】:

我正在使用 TravisCI 来run my unit tests for python 2.7, 3.4, 3.5 and 3.6。我的.travis.yml 文件包含- pip install pytest-faulthandler 行,直到2 天前我都没有遇到任何问题。然后,昨天,没有明显的原因,这条线开始导致 Travis 构建到 crash 并出现错误:

The command "pip install pytest-faulthandler" failed and exited with 1 during .

这又似乎源于一条通往 gcc 的错误路径(由 anaconda 设置?):

unable to execute 'x86_64-conda_cos6-linux-gnu-gcc': No such file or directory

详细的错误日志如下。据我所知,我没有对我的配置(travis.ymlsetup.cfgsetup.py)产生任何影响。这个问题只发生在python 2.7,对于3.4-3.6 travis 构建环境没有任何问题。

我尝试过在线搜索,看看是否有人已经经历过/解决了这个问题,但没有运气。任何建议/建议都将受到欢迎。谢谢!

Travis 错误日志如下,完整的构建日志可以在here找到。

Collecting pytest-faulthandler
  Downloading pytest_faulthandler-1.3.1-py2.py3-none-any.whl
Collecting pytest>=2.6 (from pytest-faulthandler)
  Downloading pytest-3.2.2-py2.py3-none-any.whl (187kB)
    100% |████████████████████████████████| 194kB 4.7MB/s 
Collecting faulthandler; python_version == "2.6" or python_version == "2.7" (from pytest-faulthandler)
  Downloading faulthandler-3.0.tar.gz (55kB)
    100% |████████████████████████████████| 61kB 8.7MB/s 
Requirement already satisfied: setuptools in /home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages (from pytest>=2.6->pytest-faulthandler)
Collecting py>=1.4.33 (from pytest>=2.6->pytest-faulthandler)
  Using cached py-1.4.34-py2.py3-none-any.whl
Building wheels for collected packages: faulthandler
  Running setup.py bdist_wheel for faulthandler ... error
  Complete output from command /home/travis/miniconda/envs/test-environment/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wI1YGd/faulthandler/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpyGVM8Opip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_ext
  building 'faulthandler' extension
  creating build
  creating build/temp.linux-x86_64-2.7
  x86_64-conda_cos6-linux-gnu-gcc -pthread -fno-strict-aliasing -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/travis/miniconda/envs/test-environment/include/python2.7 -c faulthandler.c -o build/temp.linux-x86_64-2.7/faulthandler.o
  unable to execute 'x86_64-conda_cos6-linux-gnu-gcc': No such file or directory
  error: command 'x86_64-conda_cos6-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for faulthandler
  Running setup.py clean for faulthandler
Failed to build faulthandler
Installing collected packages: py, pytest, faulthandler, pytest-faulthandler
  Running setup.py install for faulthandler ... error
    Complete output from command /home/travis/miniconda/envs/test-environment/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wI1YGd/faulthandler/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-lKAMMU-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'faulthandler' extension
    creating build
    creating build/temp.linux-x86_64-2.7
    x86_64-conda_cos6-linux-gnu-gcc -pthread -fno-strict-aliasing -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/travis/miniconda/envs/test-environment/include/python2.7 -c faulthandler.c -o build/temp.linux-x86_64-2.7/faulthandler.o
    unable to execute 'x86_64-conda_cos6-linux-gnu-gcc': No such file or directory
    error: command 'x86_64-conda_cos6-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/home/travis/miniconda/envs/test-environment/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wI1YGd/faulthandler/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-lKAMMU-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-wI1YGd/faulthandler/
The command "pip install pytest-faulthandler" failed and exited with 1 during .
Your build has been stopped.

【问题讨论】:

    标签: python anaconda travis-ci pytest faulthandler


    【解决方案1】:

    经过额外搜索,我找到了this related post,然后我将.travis.yml 中的miniconda 版本替换为Miniconda2-4.3.21-Linux-x86_64.sh 用于Python 2 和Miniconda3-4.3.21-Linux-x86_64.sh 用于Python 3,并通过注释掉- conda update -q conda 来阻止conda 更新。这次my environment built correctly for all python versions,问题解决了。

    如链接帖子中所述,这似乎是 Anaconda(和 miniconda)4.3.27 安装脚本中的一个错误,解决方案是使用早期版本(例如 4.3.21)并阻止 conda 更新。

    【讨论】:

      猜你喜欢
      • 2016-11-14
      • 2020-10-06
      • 2020-12-28
      • 2017-09-11
      • 2022-01-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多