question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed building wheel for opencv-python with error message - No such file or directory: 'scripts/__init__.py'

See original GitHub issue

Checklist

  1. I have searched related issues but cannot get the expected help.
  2. I have read the FAQ documentation but cannot get the expected help.

while building mmcv from source (by using “MMCV_WITH_OPS=1 FORCE_CUDA=1 pip install -e .”) in RHEL Server 7.6, with python 3.7.3, gcc 7.3.0, pytorch 1.7.1 and cuda 10.2, I am encountering an error “ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects”. Last few lines of the traceback says -

File "setup.py", line 289, in main
      cmake_source_dir=cmake_source_dir,
    File "/tmp/pip-build-env-_w_vgir1/overlay/lib/python3.7/site-packages/skbuild/setuptools_wrap.py", line 629, in setup
      cmake_source_dir, skbuild_kw['cmake_install_dir'])
    File "setup.py", line 381, in _classify_installed_files_override
      with open('scripts/__init__.py', 'r') as custom_init:
  FileNotFoundError: [Errno 2] No such file or directory: 'scripts/__init__.py'
  ----------------
  ERROR: Failed building wheel for opencv-python

I think this is related to a very recent bugfix in opencv Exactly line 381 in setup.py (where the installation is facing the error in the traceback) has a change in the above commit of opencv. Can you please help?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dasabircommented, Nov 16, 2021

Hi @dasabir , is there any progress?

Hi @zhouzaida . Yes, I was just going to post. Finally I could manage to install mmcv. The issue was with the right LD_LIBRARY_PATH and one more env variable CPATH. CPATH was somehow not set. When I exported the cuda/10.2/include path to CPATH and build from source, it compiled successfully. You can close the issue. Thanks a lot for the pointers.

0reactions
zhouzaidacommented, Nov 16, 2021

Hi @dasabir , is there any progress?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not build wheels for opencv-python which use PEP 517 ...
The docker was successfully created and Tensorflow is running but while installing OpenCV using pip it is showing CMake error. root@5abf405fb92d ...
Read more >
Pip build fails: FileNotFoundError: [Errno 2] No such file or ...
Pip build fails: FileNotFoundError: [Errno 2] No such file or directory: ... Failed to build opencv-python ERROR: Could not build wheels for ...
Read more >
Error building wheel for opencv-python from source
I am trying to build opencv-python with the following environment: OS: MacOS Monterey 12.5 uname -a: Darwin Darwin Kernel Version 21.6.0 ...
Read more >
Could not build wheels for opencv-python, which is required to ...
ERROR: Failed building wheel for opencv-python. Failed to build opencv-python ... cannot open shared object file: No such file or directory.
Read more >
Python OpenCV installation error - NXP Community
Solved: I am trying to install OpenCV package for Python on my 8MM NavQ Computer using pip package installer. I am facing the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found