Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'ENABLE_HEADLESS=1 python3 setup.py bdist_wheel' fails during "Copying files from CMake output" with not found exception #237

Closed
cons0l3 opened this issue Aug 20, 2019 · 6 comments

Comments

@cons0l3
Copy link

@cons0l3 cons0l3 commented Aug 20, 2019

Expected behaviour

compile opencv-python on rabsian 10 (buster, Linux raspberrypi 4.19.57+ #1244 Thu Jul 4 18:42:50 BST 2019 armv6l GNU/Linux) from source directly, no cross compile without exception

python 3.7.3
opencv-python 4.1.0.25 release tag 25
numpy-1.17.0-cp37-cp37m-linux_armv6l.whl

git submodule
-951b6c64f01853cf2569000bb30ecd01a16bba0b multibuild
371bba8f54560b374fbcd47e7e02f015ac4969ad opencv (4.1.0)
-2c32791a9c500343568a21ea34bf2daeac2adae7 opencv_contrib

Actual behaviour

are setup.py:69 or setup.py:83 deprecation warnings already hinting at the upcoming exception?

~> ENABLE_HEADLESS=1 python3 setup.py bdist_wheel

Synchronizing submodule url for 'opencv'
Version:  4.1.0.25
setup.py:69: DeprecationWarning: SO is deprecated, use EXT_SUFFIX
  (['*.dll'] if os.name == 'nt' else []) +
setup.py:83: DeprecationWarning: SO is deprecated, use EXT_SUFFIX
  ['python/cv2[^/]*%(ext)s' % {'ext': re.escape(sysconfig.get_config_var('SO'))}],
[  6%] Built target libjpeg-turbo
[ 11%] Built target libtiff
[ 23%] Built target libwebp
[ 27%] Built target libjasper
[ 35%] Built target IlmImf
[ 43%] Built target libprotobuf
[ 43%] Built target quirc
[ 48%] Built target carotene_objs
[ 49%] Built target tegra_hal
[ 51%] Built target ade
[ 51%] Built target opencv_videoio_plugins
[ 60%] Built target opencv_core
[ 60%] Built target opencv_flann
[ 66%] Built target opencv_imgproc
[ 68%] Built target opencv_ml
[ 70%] Built target opencv_photo
[ 80%] Built target opencv_dnn
[ 85%] Built target opencv_gapi
[ 88%] Built target opencv_imgcodecs
[ 89%] Built target opencv_videoio
[ 89%] Built target opencv_highgui
[ 92%] Built target opencv_features2d
[ 96%] Built target opencv_calib3d
[ 97%] Built target opencv_objdetect
[ 98%] Built target opencv_stitching
[100%] Built target opencv_video
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /home/pi/opencv-python.git/_skbuild/linux-armv6l-3.7/cmake-install/share/licenses/opencv4/opencl-headers-LICENSE.txt
[...]
Copying files from CMake output
Traceback (most recent call last):
  File "setup.py", line 389, in <module>
    main()
  File "setup.py", line 211, in main
    cmake_source_dir=cmake_source_dir,
  File "/home/pi/.local/lib/python3.7/site-packages/skbuild/setuptools_wrap.py", line 604, in setup
    cmake_source_dir, skbuild_kw['cmake_install_dir'])
  File "setup.py", line 301, in _classify_installed_files_override
    if not found: raise Exception("Not found: '%s'" % relpath_re)
Exception: Not found: 'python/cv2[^/]*\.cpython\-37m\-arm\-linux\-gnueabihf\.so'

Steps to reproduce

  • freshly setup rasbian 10 on rasberry pi
  • install python3 (apt install python3 python3-pip)
  • install buildstuff (apt install git cmake...)
  • clone opencv-python repo and checkout tag 25
  • run ENABLE_HEADLESS=1 python setup.py bdist_wheel
@skvark
Copy link
Owner

@skvark skvark commented Aug 29, 2019

Please check the name of the cv2.cpython-37m-something-something.so, it seems that the regex pattern does not match with the resulting binary name. I don't have a Raspberry Pi available so I can't check this myself.

@kureta
Copy link

@kureta kureta commented Feb 1, 2020

Where would the resulting binary be?

@skvark
Copy link
Owner

@skvark skvark commented Feb 1, 2020

The build output should be under cmake-install/python/.

Something like this:

/home/pi/opencv-python.git/_skbuild/linux-armv6l-3.7/cmake-install/python/

@zrss
Copy link

@zrss zrss commented Apr 12, 2020

/cc

i build opencv-python in an arm arch machine, it also can't find the file and lack of the cmake-install/python/

and finally, i found it out, i have two python versions installed, as py3 and py2, and it seems the cmake try to build py2, but my py2 lack of the numpy and i want to use the py3 for building ....

i modify the setup.py, and add the

-DPYTHON_DEFAULT_EXECUTABLE=/usr/local/python3.7/bin/python3.7

for cmake args , now it works well

@AshokBhat
Copy link

@AshokBhat AshokBhat commented Jul 12, 2020

Hi, I am trying to build opencv-python on an AArch64 machine running Ubuntu 20.04. I get the error mentioned above.

...
Traceback (most recent call last):
  File "setup.py", line 439, in <module>
    main()
  File "setup.py", line 188, in main
    skbuild.setup(
  File "/usr/local/lib/python3.8/dist-packages/skbuild/setuptools_wrap.py", line 621, in setup
    _classify_installed_files(cmake_manifest, package_data, package_prefixes,
  File "setup.py", line 340, in _classify_installed_files_override
    raise Exception("Not found: '%s'" % relpath_re)
Exception: Not found: 'python/cv2[^/]*\.cpython\-38\-aarch64\-linux\-gnu\.so'

My cmake-install directory does not have python directory.

ls ./_skbuild/linux-aarch64-3.8/cmake-install/
bin  include  lib  share

I did add "-DPYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3.8" into the cmake_args in `setup.py'.
Any ideas?

@skvark
Copy link
Owner

@skvark skvark commented Aug 9, 2020

Usually the build has failed at earlier step when the Exception: Not found error is thrown (no .so file was generated). Please refer to the README of this repository, the setup.py file has been refactored. Manual builds are now easier to do.

@skvark skvark closed this Aug 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants