Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Build with pip3: No such file or directory: '_skbuild/linux-x86_64-3.9/cmake-install/python/cv2/__init__.py'

Abierto
#663 1 comentario 0 reacciones 1 asignado Ver en GitHub

@asenyaev ya está trabajando en esto.

Desde el 7/6/2022.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Hi,

Expected behaviour

I am trying to build a small software using Flatpak. One of the dependencies is opencv-headless (I chose blindly the latest version 4.5.5.64, maybe a previous version would be a better choice) and needs to be built with pip (22.0.4, Python 3.9) during the Flatpak build process.

Actual behaviour

Unfortunately, while other dependencies build successfully, OpenCV build fails with the following error:

  Configuring Project                                                                                                                                                  
    Working directory:                                                                                                                                                 
      /tmp/pip-install-lo__bgyw/opencv-python-headless_aabd86c2a569434cb5951bb7f10731d3/_skbuild/linux-x86_64-3.9/cmake-build                                          
    Command:                                                                                                                                                           
      cmake /tmp/pip-install-lo__bgyw/opencv-python-headless_aabd86c2a569434cb5951bb7f10731d3/opencv -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-install-lo__bgyw/ope
ncv-python-headless_aabd86c2a569434cb5951bb7f10731d3/_skbuild/linux-x86_64-3.9/cmake-install -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -DPYTHON_VERSION_STRING:STRI
NG=3.9.9 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.9 -DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.9.so -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PA
TH:PATH=/app/lib/python3.9/site-packages/skbuild/resources/cmake -DPYTHON3_EXECUTABLE=/usr/bin/python3 -DPYTHON3_INCLUDE_DIR=/usr/include/python3.9 -DPYTHON3_LIBRARY=/
usr/lib/x86_64-linux-gnu/libpython3.9.so -DBUILD_opencv_python3=ON -DBUILD_opencv_python2=OFF -DBUILD_opencv_java=OFF -DOPENCV_PYTHON3_INSTALL_PATH=python -DINSTALL_CR
EATE_DISTRIB=ON -DBUILD_opencv_apps=OFF -DBUILD_opencv_freetype=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_DOCS=OFF -DPYTHON3_LIMITED
_API=ON -DBUILD_OPENEXR=ON -DBUILD_PNG=ON -DWITH_WIN32UI=OFF -DWITH_QT=OFF -DWITH_GTK=OFF -DCMAKE_BUILD_TYPE:STRING=Release                                            
                                                                                                                                                                       
  Copying files from CMake output                                                                                                                                      
  Traceback (most recent call last):                                                                                                                                   
    File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>                                                        
      main()                                                                                                                                                           
    File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main                                                            
      json_out['return_val'] = hook(**hook_input['kwargs'])                                                                                                            
    File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel                                                     
      return _build_backend().build_wheel(wheel_directory, config_settings,                                                                                            
    File "/usr/lib/python3.9/site-packages/setuptools/build_meta.py", line 230, in build_wheel                                                                         
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',                                                                                                        
    File "/usr/lib/python3.9/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir                                                                
      self.run_setup()                                                                                                                                                 
    File "/usr/lib/python3.9/site-packages/setuptools/build_meta.py", line 267, in run_setup                                                                           
      super(_BuildMetaLegacyBackend,                                                                                                                                   
    File "/usr/lib/python3.9/site-packages/setuptools/build_meta.py", line 158, in run_setup                                                                           
      exec(compile(code, __file__, 'exec'), locals())                                                                                                                  
    File "setup.py", line 503, in <module>                                                                                                                             
      main()                                                                                                                                                           
    File "setup.py", line 240, in main                                                                                                                                 
      skbuild.setup(                                                                                                                                                   
    File "/app/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 676, in setup                                                                                   _classify_installed_files(                                                                                                                                           File "setup.py", line 373, in _classify_installed_files_override                                                                                                         with open(os.path.join(cmake_install_dir, "python", "cv2", "__init__.py"), 'r') as opencv_init:
  FileNotFoundError: [Errno 2] No such file or directory: '_skbuild/linux-x86_64-3.9/cmake-install/python/cv2/__init__.py'
  error: subprocess-exited-with-error
   
  × Building wheel for opencv-python-headless (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
   
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/bin/python3 /usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpbnt_xnkn
  cwd: /tmp/pip-install-lo__bgyw/opencv-python-headless_aabd86c2a569434cb5951bb7f10731d3
  Building wheel for opencv-python-headless (pyproject.toml) ... error
  ERROR: Failed building wheel for opencv-python-headless

It looks very much like #600, but in my case pip seems new enough and I suppose I can't change install location (as suggested in https://github.com/opencv/opencv-python/issues/600#issuecomment-1003108190).

Maybe I am missing something obvious. Any suggestion is welcome (maybe try building with an older version, but which one?).

Regards,
Yvan

Lenguaje dominante
Python
Estrellas
5.4k
Forks
1k
Merge medio
22 h 17 min
PR fusionados (30 d)
3

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de opencv/opencv-python

Todos los issues de opencv/opencv-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.