( martonmiklos | 2022. 02. 08., k – 22:30 )

Hát lehet mégis kellene valami python only megoldás, mert ez a cython (ahogy sejtettem) egy masszív szopóroller...

Kiforkoltam, megfixeltem majd:

pi@raspberrypi:~/brute_force2/sw $ pip3 install -e git+https://gitlab.com/martonmiklos/PyV4L2Camera.git@dealloc_buffer_on_close#egg=PyV4L2Camera
............
-Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c PyV4L2Camera/camera.c -o build/temp.linux-armv7l-3.7/PyV4L2Camera/camera.o
    arm-linux-gnueabihf-gcc: error: PyV4L2Camera/camera.c: Nincs ilyen fájl vagy könyvtár
    arm-linux-gnueabihf-gcc: fatal error: no input files
    compilation terminated.
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
    
    ----------------------------------------
  Rolling back uninstall of PyV4L2Camera
Command "/usr/bin/python3 -c "import setuptools, tokenize;__file__='/home/pi/brute_force2/sw/src/pyv4l2camera/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps --user --prefix=" failed with error code 1 in /home/pi/brute_force2/sw/src/pyv4l2camera/

 

camera.c WTF?

Ja a setup.py-nak van egy --use-cython argumentuma ami azt állítja, hogy c vagy pyx fájloakt fordítson. Tegyük defaulttá!

 

Eredmény:

pi@raspberrypi:~/brute_force2/sw $ pip3 install  git+https://gitlab.com/martonmiklos/PyV4L2Camera.git@dealloc_buffer_on_close
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting git+https://gitlab.com/martonmiklos/PyV4L2Camera.git@dealloc_buffer_on_close
  Cloning https://gitlab.com/martonmiklos/PyV4L2Camera.git (to revision dealloc_buffer_on_close) to /tmp/pip-req-build-o9dudhah
Branch 'dealloc_buffer_on_close' set up to track remote branch 'dealloc_buffer_on_close' from 'origin'.
Switched to a new branch 'dealloc_buffer_on_close'
    Complete output from command python setup.py egg_info:
    Compiling PyV4L2Camera/camera.pyx because it changed.
    Compiling PyV4L2Camera/controls.pyx because it changed.
    [1/2] Cythonizing PyV4L2Camera/camera.pyx
    
    Error compiling Cython file:
    ------------------------------------------------------------
    ...
    from v4l2 cimport *
    ^
    ------------------------------------------------------------
    
    PyV4L2Camera/camera.pyx:1:0: 'PyV4L2Camera/camera' is not a valid module name
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-o9dudhah/setup.py", line 28, in <module>
        extensions = cythonize(extensions)
      File "/home/pi/.local/lib/python3.7/site-packages/Cython/Build/Dependencies.py", line 1117, in cythonize
        cythonize_one(*args)
      File "/home/pi/.local/lib/python3.7/site-packages/Cython/Build/Dependencies.py", line 1284, in cythonize_one
        raise CompileError(None, pyx_file)
    Cython.Compiler.Errors.CompileError: PyV4L2Camera/camera.pyx

(pip3 install v4l2 megvolt már)