gpt4 book ai didi

python - Anaconda 在 TravisCI for python 2.7 上构建故障处理程序的轮子失败

转载 作者:太空宇宙 更新时间:2023-11-03 14:42:45 25 4
gpt4 key购买 nike

我正在使用 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有错误:

命令“pip install pytest-faulthandler”失败并以 1 退出。

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

无法执行“x86_64-conda_cos6-linux-gnu-gcc”:没有这样的文件或目录

下面有详细的错误日志。据我所知,我没有对我的配置(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.

最佳答案

经过额外搜索,我发现 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 更新。

关于python - Anaconda 在 TravisCI for python 2.7 上构建故障处理程序的轮子失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46473498/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com