Cannot install because a test failed: 60 - ExportImport (Failed)
The problem is:
So I'm trying to install opencv-python on Alpine linux 3.12 that is running in a docker container. The installation process cannot complete. It fails with the following error:
The following tests FAILED:
60 - ExportImport (Failed)
Errors while running CTest
ninja: job failed: cd /tmp/pip-install-xrdxmys3/cmake/_skbuild/linux-x86_64-3.8/cmake-build/CMakeProject-build && ./bin/ctest --force-new-ctest-process --stop-on-failure --output-on-failure -j2 -E BootstrapTest && /usr/bin/cmake -E touch /tmp/pip-install-xrdxmys3/cmake/_skbuild/linux-x86_64-3.8/cmake-build/CMakeProject-build-prefix/src/CMakeProject-build-stamp/CMakeProject-build-run_cmake_test_suite
ninja: subcommand failed
File "/tmp/pip-build-env-nl2ajiuq/overlay/lib/python3.8/site-packages/skbuild/setuptools_wrap.py", line 645, in setup
cmkr.make(make_args, install_target=cmake_install_target, env=env)
File "/tmp/pip-build-env-nl2ajiuq/overlay/lib/python3.8/site-packages/skbuild/cmaker.py", line 680, in make
self.make_impl(clargs=clargs, config=config, source_dir=source_dir, install_target=install_target, env=env)
File "/tmp/pip-build-env-nl2ajiuq/overlay/lib/python3.8/site-packages/skbuild/cmaker.py", line 704, in make_impl
raise SKBuildError(
Before installing the opencv-python package i have installed these dependencies:
apk add --no-cache python3 py3-pip cmake ninja gcc libgcc libc-dev g++ openssl openssl-dev linux-headers python3-dev
Do i need to install OpenCL and do i need a hardware that supports OpenCL or CUDA?
Also i have the same error output when i try to install opencv-python-headless.
System description
- Alpine Linux 3.12 x86_64
- Python version 3.8
- opencv-python version - latest from pip
I'm also attaching the whole output of the pip install opencv-python command. It contains the whole output and some notes to the developers that are generated by the install script. It's almost 3K lines so it's not suitable for pasting it here as.
opencv-python-install-output.txt
Thank you.
- OpenCL and CUDA are optional and will not be used/compiled if not available.
- According to the provided log the issue is not related to OpenCL. Pip tried to build CMake from sources and the process crashed on some CMake unit test:
94/591 Test #60: ExportImport ......................................***Failed 4.80 sec
I propose to install cmake as long as compiler with Alpine package manager, but not with pip.
@asmorkalov yes, you are right. It turned out that the problem is from cmake. The strange thing is that i have already installed cmake with the package manager and it still requires the cmake installed with pip.
Anyway, in the end i have used another docker image where the cmake installs from pip without any issues. Thank you for your help and have a nice day.