Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#663 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

@asenyaev đang làm issue này rồi.

Từ ngày 7/6/2022.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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

Ngôn ngữ chính
Python
Star
5.4k
Fork
1k
Merge trung bình
22 giờ 17 phút
Pull request đã merge (30 ngày)
3

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của opencv/opencv-python

Tất cả issue của opencv/opencv-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.