koush / scrypted

Scrypted is a high performance video integration and automation platform
https://scrypted.app
Other
4.1k stars 243 forks source link

OpenCV will not load, cannot build wheel #657

Closed jlg89 closed 1 year ago

jlg89 commented 1 year ago
server version: 0.7.28
plugin version: @scrypted/opencv 0.0.69
########################
3/25/2023, 3:24:15 PM
########################
python version: python3.9
requirements.txt (outdated)
# plugin
numpy>=1.16.2
# pillow for anything not intel linux
Pillow>=5.4.1; sys_platform != 'linux' or platform_machine != 'x86_64'
pillow-simd; sys_platform == 'linux' and platform_machine == 'x86_64'
PyGObject>=3.30.4; sys_platform != 'win32'
imutils>=0.5.0
# not available on armhf
av>=10.0.0; sys_platform != 'linux' or platform_machine == 'x86_64' or platform_machine == 'aarch64'
# not available on armhf
opencv-python; sys_platform != 'linux' or platform_machine == 'x86_64' or platform_machine == 'aarch64'

Ignoring pillow-simd: markers 'sys_platform == "linux" and platform_machine == "x86_64"' don't match your environment
Requirement already satisfied: numpy>=1.16.2 in /usr/lib/python3/dist-packages (from -r /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322/requirements.txt (line 2)) (1.19.5)
Requirement already satisfied: Pillow>=5.4.1 in /usr/lib/python3/dist-packages (from -r /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322/requirements.txt (line 4)) (8.1.2)
Requirement already satisfied: PyGObject>=3.30.4 in /usr/lib/python3/dist-packages (from -r /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322/requirements.txt (line 6)) (3.38.0)
Collecting imutils>=0.5.0
  Using cached imutils-0.5.4.tar.gz (17 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting av>=10.0.0
  Using cached av-10.0.0.tar.gz (2.4 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [29 lines of output]
      Package libavformat was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libavformat.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libavformat' found
      Package libavcodec was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libavcodec.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libavcodec' found
      Package libavdevice was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libavdevice.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libavdevice' found
      Package libavutil was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libavutil.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libavutil' found
      Package libavfilter was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libavfilter.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libavfilter' found
      Package libswscale was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libswscale.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libswscale' found
      Package libswresample was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libswresample.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libswresample' found
      pkg-config could not find libraries ['avformat', 'avcodec', 'avdevice', 'avutil', 'avfilter', 'swscale', 'swresample']
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel 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.
pip install result 1
koush commented 1 year ago

what host os and architecture? docker?

jlg89 commented 1 year ago

Sorry...yes, Docker, on Raspberry Pi v11

6.1.19-v8+ #1637 SMP PREEMPT Tue Mar 14 11:11:47 GMT 2023 aarch64 GNU/Linux

Docker version 20.10.23, build 7155243

koush commented 1 year ago

32bit or 64bit os

jlg89 commented 1 year ago

We're simultyping.

koush commented 1 year ago

in scrypted terminal run:

apt-get install -y libavformat-dev

Then reload opencv plugin

koush commented 1 year ago

Does the python-codecs plugin load?

jlg89 commented 1 year ago

Better, still errors. The python-codecs plugin gives the same error.

########################
3/25/2023, 3:43:41 PM
########################
python version: python3.9
requirements.txt (outdated)
# plugin
numpy>=1.16.2
# pillow for anything not intel linux
Pillow>=5.4.1; sys_platform != 'linux' or platform_machine != 'x86_64'
pillow-simd; sys_platform == 'linux' and platform_machine == 'x86_64'
PyGObject>=3.30.4; sys_platform != 'win32'
imutils>=0.5.0
# not available on armhf
av>=10.0.0; sys_platform != 'linux' or platform_machine == 'x86_64' or platform_machine == 'aarch64'
# not available on armhf
opencv-python; sys_platform != 'linux' or platform_machine == 'x86_64' or platform_machine == 'aarch64'

Ignoring pillow-simd: markers 'sys_platform == "linux" and platform_machine == "x86_64"' don't match your environment
Requirement already satisfied: numpy>=1.16.2 in /usr/lib/python3/dist-packages (from -r /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322/requirements.txt (line 2)) (1.19.5)
Requirement already satisfied: Pillow>=5.4.1 in /usr/lib/python3/dist-packages (from -r /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322/requirements.txt (line 4)) (8.1.2)
Requirement already satisfied: PyGObject>=3.30.4 in /usr/lib/python3/dist-packages (from -r /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322/requirements.txt (line 6)) (3.38.0)
Collecting imutils>=0.5.0
  Using cached imutils-0.5.4.tar.gz (17 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting av>=10.0.0
  Using cached av-10.0.0.tar.gz (2.4 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [13 lines of output]
      Package libavdevice was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libavdevice.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libavdevice' found
      Package libavfilter was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libavfilter.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libavfilter' found
      Package libswscale was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libswscale.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libswscale' found
      pkg-config could not find libraries ['avformat', 'avcodec', 'avdevice', 'avutil', 'avfilter', 'swscale', 'swresample']
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel 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.
pip install result 1
koush commented 1 year ago

apt install libavdevice-dev

koush commented 1 year ago

Are you using a lite or thin image? or the full docker image? I don't understand why you're missing these. Works fine in docker arm64 for me.

jlg89 commented 1 year ago

I wonder if an update bit me at some point. Looks like it's building everything now, just taking awhile. I'm pretty sure I used the full image. I've slept since then.

jlg89 commented 1 year ago

Am I hitting a watchdog timer or something? It looks like things are building, they're just taking awhile, and then suddenly the plugin reloads.

server version: 0.7.28
plugin version: @scrypted/opencv 0.0.69
########################
3/25/2023, 4:00:13 PM
########################
python version: python3.9
requirements.txt (outdated)
# plugin
numpy>=1.16.2
# pillow for anything not intel linux
Pillow>=5.4.1; sys_platform != 'linux' or platform_machine != 'x86_64'
pillow-simd; sys_platform == 'linux' and platform_machine == 'x86_64'
PyGObject>=3.30.4; sys_platform != 'win32'
imutils>=0.5.0
# not available on armhf
av>=10.0.0; sys_platform != 'linux' or platform_machine == 'x86_64' or platform_machine == 'aarch64'
# not available on armhf
opencv-python; sys_platform != 'linux' or platform_machine == 'x86_64' or platform_machine == 'aarch64'

Ignoring pillow-simd: markers 'sys_platform == "linux" and platform_machine == "x86_64"' don't match your environment
Requirement already satisfied: numpy>=1.16.2 in /usr/lib/python3/dist-packages (from -r /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322/requirements.txt (line 2)) (1.19.5)
Requirement already satisfied: Pillow>=5.4.1 in /usr/lib/python3/dist-packages (from -r /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322/requirements.txt (line 4)) (8.1.2)
Requirement already satisfied: PyGObject>=3.30.4 in /usr/lib/python3/dist-packages (from -r /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322/requirements.txt (line 6)) (3.38.0)
Collecting imutils>=0.5.0
  Using cached imutils-0.5.4.tar.gz (17 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting av>=10.0.0
  Using cached av-10.0.0.tar.gz (2.4 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: still running...
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting opencv-python
  Using cached opencv-python-4.7.0.72.tar.gz (91.1 MB)
  Installing build dependencies: started
server version: 0.7.28
plugin version: @scrypted/opencv 0.0.69
########################
3/25/2023, 4:02:28 PM
########################
python version: python3.9
...
koush commented 1 year ago

it shouldn't build. should use prebuilt wheels.

you can check the events tab to see why it's being restarted. might be a watchdog.

jlg89 commented 1 year ago
11:04:43 AM | e | @scrypted/opencv error Error: read ECONNRESET
11:04:43 AM | e | plugin load error Error: plugin killed host:@scrypted/opencv
11:04:43 AM | a | Plugin failed to load. View Console for more information.
11:04:43 AM | i | pid 6136
11:04:43 AM | i | loading @scrypted/opencv
11:04:28 AM | i | plugin restart was requested
11:04:28 AM | e | plugin is unresponsive. restarting.

jlg89 commented 1 year ago

should I just backup the config, wipe & redo the docker image?

koush commented 1 year ago

I see, let me resolve this

jlg89 commented 1 year ago

Not sure if this is helpful or not...

# apt search opencv | grep installed

libopencv-calib3d4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
libopencv-contrib4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
libopencv-core4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
libopencv-dnn4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
libopencv-features2d4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
libopencv-flann4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
libopencv-highgui4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
libopencv-imgcodecs4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
libopencv-imgproc4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
libopencv-ml4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
libopencv-objdetect4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
libopencv-photo4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
libopencv-shape4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
libopencv-stitching4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
libopencv-video4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
libopencv-videoio4.5/stable,now 4.5.1+dfsg-5 armhf [installed,automatic]
python3-opencv/stable,now 4.5.1+dfsg-5 armhf [installed]
koush commented 1 year ago

should be fixed in new image.

jlg89 commented 1 year ago

Holy cow, it vomited on me.

errorlog.txt

koush commented 1 year ago

can you delete opencv and reinstall it

jlg89 commented 1 year ago

Did these, then deleted/reinstalled opencv. Still fails, a configure step fails because it can't find OpenSSL:

apt install libavdevice-dev
apt install python3-openssl

errorlog.txt

jlg89 commented 1 year ago

Ran "apt install libssl-dev" and seeing if that helped...

koush commented 1 year ago

Not sure why your docker image is doing that. I tested on aarch64 clean install and here's my output. It uses prebuilt wheels:

server version: 0.7.29
plugin version: @scrypted/opencv 0.0.69
########################
3/25/2023, 6:15:38 PM
########################
error: XDG_RUNTIME_DIR not set in the environment.
python version: python3.9
requirements.txt (outdated)
# plugin
numpy>=1.16.2
# pillow for anything not intel linux
Pillow>=5.4.1; sys_platform != 'linux' or platform_machine != 'x86_64'
pillow-simd; sys_platform == 'linux' and platform_machine == 'x86_64'
PyGObject>=3.30.4; sys_platform != 'win32'
imutils>=0.5.0
# not available on armhf
av>=10.0.0; sys_platform != 'linux' or platform_machine == 'x86_64' or platform_machine == 'aarch64'
# not available on armhf
opencv-python; sys_platform != 'linux' or platform_machine == 'x86_64' or platform_machine == 'aarch64'

Ignoring pillow-simd: markers 'sys_platform == "linux" and platform_machine == "x86_64"' don't match your environment
Collecting numpy>=1.16.2
  Downloading numpy-1.24.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.0/14.0 MB 102.8 MB/s eta 0:00:00
Collecting Pillow>=5.4.1
  Downloading Pillow-9.4.0-cp39-cp39-manylinux_2_28_aarch64.whl (3.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.1/3.1 MB 41.3 MB/s eta 0:00:00
Requirement already satisfied: PyGObject>=3.30.4 in /usr/lib/python3/dist-packages (from -r /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322/requirements.txt (line 6)) (3.38.0)
Collecting imutils>=0.5.0
  Downloading imutils-0.5.4.tar.gz (17 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting av>=10.0.0
  Downloading av-10.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (29.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 29.5/29.5 MB 69.8 MB/s eta 0:00:00
Collecting opencv-python
  Downloading opencv_python-4.7.0.72-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (40.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.4/40.4 MB 57.5 MB/s eta 0:00:00
Collecting pycairo>=1.11.1
  Downloading pycairo-1.23.0.tar.gz (344 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 344.6/344.6 kB 82.3 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: imutils, pycairo
  Building wheel for imutils (setup.py): started
  Building wheel for imutils (setup.py): finished with status 'done'
  Created wheel for imutils: filename=imutils-0.5.4-py3-none-any.whl size=25858 sha256=ebdfd3ace472058b68a2d0c389dfd6bdcf9c038d38526eed5fab13fb1608aa7a
  Stored in directory: /root/.cache/pip/wheels/4b/a5/2d/4a070a801d3a3d93f033d3ee9728f470f514826e89952df3ea
  Building wheel for pycairo (pyproject.toml): started
  Building wheel for pycairo (pyproject.toml): finished with status 'done'
  Created wheel for pycairo: filename=pycairo-1.23.0-cp39-cp39-linux_aarch64.whl size=310359 sha256=63438845223ca40eb7c963d562c43cd21d2de571597c6a0e1699fe963506a309
  Stored in directory: /root/.cache/pip/wheels/7e/33/44/ed63d7850b41775b9c99e2677fe7cc4c6afd3b3eb767be75e7
Successfully built imutils pycairo
Installing collected packages: imutils, av, pycairo, Pillow, numpy, opencv-python
Successfully installed Pillow-9.4.0 av-10.0.0 imutils-0.5.4 numpy-1.24.2 opencv-python-4.7.0.72 pycairo-1.23.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
pip install result 0
site-packages: /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322/lib/python3.9/site-packages
jlg89 commented 1 year ago

The running process is:

/usr/bin/python3 -m pip install -r /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322/requirements.txt --prefix /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322

Not sure why it's building vs. pulling prebuilt.

So far we're at...

Collecting opencv-python
  Using cached opencv-python-4.7.0.72.tar.gz (91.1 MB)
  Installing build dependencies: started
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
koush commented 1 year ago

can you spin up a brand new temp docker image:

docker run --rm -p 10444:10443 koush/scrypted

It will be available on port 10444 (and can work side by side with your existing installation). it will also fully delete itself once you exit.

Install OpenCV on that.

jlg89 commented 1 year ago
server version: 0.7.29
plugin version: @scrypted/opencv 0.0.69
########################
3/25/2023, 6:26:54 PM
########################
error: XDG_RUNTIME_DIR not set in the environment.
python version: python3.9
requirements.txt (outdated)
# plugin
numpy>=1.16.2
# pillow for anything not intel linux
Pillow>=5.4.1; sys_platform != 'linux' or platform_machine != 'x86_64'
pillow-simd; sys_platform == 'linux' and platform_machine == 'x86_64'
PyGObject>=3.30.4; sys_platform != 'win32'
imutils>=0.5.0
# not available on armhf
av>=10.0.0; sys_platform != 'linux' or platform_machine == 'x86_64' or platform_machine == 'aarch64'
# not available on armhf
opencv-python; sys_platform != 'linux' or platform_machine == 'x86_64' or platform_machine == 'aarch64'

Ignoring pillow-simd: markers 'sys_platform == "linux" and platform_machine == "x86_64"' don't match your environment
Requirement already satisfied: numpy>=1.16.2 in /usr/lib/python3/dist-packages (from -r /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322/requirements.txt (line 2)) (1.19.5)
Requirement already satisfied: Pillow>=5.4.1 in /usr/lib/python3/dist-packages (from -r /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322/requirements.txt (line 4)) (8.1.2)
Requirement already satisfied: PyGObject>=3.30.4 in /usr/lib/python3/dist-packages (from -r /server/volume/plugins/@scrypted/opencv/python3.9-Linux-aarch6420230322/requirements.txt (line 6)) (3.38.0)
Collecting imutils>=0.5.0
  Downloading imutils-0.5.4.tar.gz (17 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting av>=10.0.0
  Downloading av-10.0.0.tar.gz (2.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.4/2.4 MB 617.5 kB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [29 lines of output]
      Package libavformat was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libavformat.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libavformat' found
      Package libavcodec was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libavcodec.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libavcodec' found
      Package libavdevice was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libavdevice.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libavdevice' found
      Package libavutil was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libavutil.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libavutil' found
      Package libavfilter was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libavfilter.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libavfilter' found
      Package libswscale was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libswscale.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libswscale' found
      Package libswresample was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libswresample.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libswresample' found
      pkg-config could not find libraries ['avformat', 'avcodec', 'avdevice', 'avutil', 'avfilter', 'swscale', 'swresample']
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel 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.
pip install result 1
jlg89 commented 1 year ago

Ran "apt install libavdevice-dev libssl-dev" and reloaded plugin, it's now building everything just like the other instance. Must be something screwy with my

koush commented 1 year ago

In a Scrytped terminal, run the following:

python3

Then in the python terminal:

import platform
platform.uname()
platform.processor()

Expected output should look like this (on my Mac):

>>> import platform
>>> platform.uname()
>>> platform.processor()
uname_result(system='Darwin', node='Koushik-MacStudio.localdomain', release='22.4.0', version='Darwin Kernel Version 22.4.0: Wed Feb 22 22:12:01 PST 2023; root:xnu-8796.100.763.505.1~1/RELEASE_ARM64_T6000', machine='arm64')
'arm'
jlg89 commented 1 year ago

Aha.

# python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.uname()
uname_result(system='Linux', node='35b80d814d06', release='6.1.19-v8+', version='#1637 SMP PREEMPT Tue Mar 14 11:11:47 GMT 2023', machine='aarch64')
>>> platform.processor()
''
>>> platform.architecture()
('32bit', 'ELF')
koush commented 1 year ago

what in gods name, this is in the scrypted terminal?

jlg89 commented 1 year ago

Yup. The fresh one that we just spun up.

koush commented 1 year ago

pi 4 here

image
koush commented 1 year ago

what pi model?

jlg89 commented 1 year ago

It's a pi 4. I upgraded from a 3B+ awhile back, and I'm trying to remember if I did a fresh SD card at that time or just swapped it and then upgraded to 11 on top of 10. Given this weird stuff, I bet that's what I did. But OpenCV has been working fine, up until maybe a week or two ago.

koush commented 1 year ago

It's a pi 4. I upgraded from a 3B+ awhile back, and I'm trying to remember if I did a fresh SD card at that time or just swapped it and then upgraded to 11 on top of 10. Given this weird stuff, I bet that's what I did. But OpenCV has been working fine, up until maybe a week or two ago.

yeah that will do it I think. do a fresh install and confirm.

koush commented 1 year ago

@jlg89 can you run the following on both scrypted terminal and the host OS?

file $(which docker)
jlg89 commented 1 year ago

I did a fresh burn of the HOOBS 4.3 image (which is based on Bullseye), copied over the .scrypted directory etc., and everything worked, until I used the "check for updates" button in HOOBS, and it updated the kernel from v71+/arm71 to v8+/aarch64. Now the Python Codecs aren't loading again.

This is covered by https://github.com/koush/scrypted/issues/678 but it's worth noting that it happened with a fresh install of HOOBS, that apparently broke itself by updating.

nbeathoven commented 1 year ago

Hello,

Same issue even after what was suggested in #678 . Hoops 4.3 on RPI4 4GB.

Made the modification arm_64bit=0 under boot/config.txt and restarted the box.

Arlo Plug in 0.8.3 works but anything after even up to 0.8.13 fails

linux arm #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 server version: 0.39.0 plugin version: @scrypted/arlo 0.8.13 full ######################## 7/23/2023, 10:22:15 PM ########################

Python machine vs architecture mismatch detected. Plugin installation may fail. This issue occurs if a 32bit system was upgraded to a 64bit kernel. Reverting to the 32bit kernel (or reflashing as native 64 bit is recommended. https://github.com/koush/scrypted/issues/678

python version: python3.10 python prefix: /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608 Removing old dependencies: /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608 requirements.txt (outdated) paho-mqtt==1.6.1 sseclient==0.0.22 aiohttp==3.8.4 requests==2.28.2 cachetools==5.3.0 scrypted-arlo-go==0.4.0 cloudscraper==1.2.71 curl-cffi==0.5.7; platform_machine != 'armv7l' async-timeout==4.0.2 beautifulsoup4==4.12.2 --extra-index-url=https://www.piwheels.org/simple/ --extra-index-url=https://bjia56.github.io/scrypted-arlo-go/ --prefer-binary Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple/, https://bjia56.github.io/scrypted-arlo-go/ Collecting paho-mqtt==1.6.1 (from -r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 1)) Using cached https://www.piwheels.org/simple/paho-mqtt/paho_mqtt-1.6.1-py3-none-any.whl (75 kB) Collecting sseclient==0.0.22 (from -r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 2)) Using cached https://www.piwheels.org/simple/sseclient/sseclient-0.0.22-py3-none-any.whl (4.4 kB) Collecting aiohttp==3.8.4 (from -r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 3)) Using cached aiohttp-3.8.4.tar.gz (7.3 MB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Installing backend dependencies: started Installing backend dependencies: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Collecting requests==2.28.2 (from -r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 4)) Using cached https://www.piwheels.org/simple/requests/requests-2.28.2-py3-none-any.whl (62 kB) Collecting cachetools==5.3.0 (from -r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 5)) Using cached https://www.piwheels.org/simple/cachetools/cachetools-5.3.0-py3-none-any.whl (9.3 kB) Collecting scrypted-arlo-go==0.4.0 (from -r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 6)) Downloading https://github.com/bjia56/scrypted-arlo-go/releases/download/v0.4.0/scrypted_arlo_go-0.4.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (4.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.0/4.0 MB 1.9 MB/s eta 0:00:00 Collecting cloudscraper==1.2.71 (from -r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 7)) Using cached https://www.piwheels.org/simple/cloudscraper/cloudscraper-1.2.71-py3-none-any.whl (99 kB) Collecting curl-cffi==0.5.7 (from -r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 8)) Using cached curl_cffi-0.5.7.tar.gz (27 kB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Collecting async-timeout==4.0.2 (from -r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 9)) Using cached https://www.piwheels.org/simple/async-timeout/async_timeout-4.0.2-py3-none-any.whl (5.8 kB) Collecting beautifulsoup4==4.12.2 (from -r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 10)) Using cached https://www.piwheels.org/simple/beautifulsoup4/beautifulsoup4-4.12.2-py3-none-any.whl (142 kB) Requirement already satisfied: six in /usr/lib/python3/dist-packages (from sseclient==0.0.22->-r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 2)) (1.16.0) Requirement already satisfied: attrs>=17.3.0 in /usr/lib/python3/dist-packages (from aiohttp==3.8.4->-r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 3)) (21.2.0) Collecting charset-normalizer<4.0,>=2.0 (from aiohttp==3.8.4->-r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 3)) Using cached https://www.piwheels.org/simple/charset-normalizer/charset_normalizer-3.2.0-py3-none-any.whl (46 kB) Collecting multidict<7.0,>=4.5 (from aiohttp==3.8.4->-r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 3)) Using cached multidict-6.0.4.tar.gz (51 kB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Installing backend dependencies: started Installing backend dependencies: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Collecting yarl<2.0,>=1.0 (from aiohttp==3.8.4->-r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 3)) Using cached yarl-1.9.2.tar.gz (184 kB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Collecting frozenlist>=1.1.1 (from aiohttp==3.8.4->-r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 3)) Using cached frozenlist-1.4.0.tar.gz (90 kB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Collecting aiosignal>=1.1.2 (from aiohttp==3.8.4->-r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 3)) Using cached https://www.piwheels.org/simple/aiosignal/aiosignal-1.3.1-py3-none-any.whl (7.6 kB) Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests==2.28.2->-r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 4)) (3.3) Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3/dist-packages (from requests==2.28.2->-r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 4)) (1.26.5) Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests==2.28.2->-r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 4)) (2020.6.20) Collecting requests-toolbelt>=0.9.1 (from cloudscraper==1.2.71->-r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 7)) Using cached https://www.piwheels.org/simple/requests-toolbelt/requests_toolbelt-1.0.0-py2.py3-none-any.whl (51 kB) Requirement already satisfied: pyparsing>=2.4.7 in /usr/lib/python3/dist-packages (from cloudscraper==1.2.71->-r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 7)) (2.4.7) Requirement already satisfied: cffi>=1.12.0 in /usr/local/lib/python3.10/dist-packages (from curl-cffi==0.5.7->-r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 8)) (1.15.1) Requirement already satisfied: soupsieve>1.2 in /usr/lib/python3/dist-packages (from beautifulsoup4==4.12.2->-r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 10)) (2.3.1) Requirement already satisfied: pycparser in /usr/local/lib/python3.10/dist-packages (from cffi>=1.12.0->curl-cffi==0.5.7->-r /server/volume/plugins/@scrypted/arlo/python3.10-Linux-aarch64-20230608/requirements.txt (line 8)) (2.21) Building wheels for collected packages: aiohttp, curl-cffi, frozenlist, multidict, yarl Building wheel for aiohttp (pyproject.toml): started Building wheel for aiohttp (pyproject.toml): finished with status 'done' Created wheel for aiohttp: filename=aiohttp-3.8.4-cp310-cp310-linux_aarch64.whl size=905869 sha256=9bc4b5ba728705daa9e6b74c85a31feece45303758a2d5beadff6c18dcfed0d7 Stored in directory: /root/.cache/pip/wheels/45/f9/f2/66c145c2f6d7b35277d17b15c7a875b85b5b69ab0f3b3fad38 Building wheel for curl-cffi (pyproject.toml): started Building wheel for curl-cffi (pyproject.toml): finished with status 'error' error: subprocess-exited-with-error

× Building wheel for curl-cffi (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [91 lines of output] /tmp/pip-build-env-pd8gakyx/overlay/local/lib/python3.10/dist-packages/setuptools/config/pyprojecttoml.py:66: _BetaConfiguration: Support for [tool.setuptools] in pyproject.toml is still beta. config = read_configuration(filepath, True, ignore_option_errors, dist) running bdist_wheel running build running build_py creating build creating build/lib.linux-aarch64-cpython-310 creating build/lib.linux-aarch64-cpython-310/curl_cffi copying curl_cffi/build.py -> build/lib.linux-aarch64-cpython-310/curl_cffi copying curl_cffi/const.py -> build/lib.linux-aarch64-cpython-310/curl_cffi copying curl_cffi/curl.py -> build/lib.linux-aarch64-cpython-310/curl_cffi copying curl_cffi/aio.py -> build/lib.linux-aarch64-cpython-310/curl_cffi copying curl_cffi/init.py -> build/lib.linux-aarch64-cpython-310/curl_cffi creating build/lib.linux-aarch64-cpython-310/curl_cffi/requests copying curl_cffi/requests/session.py -> build/lib.linux-aarch64-cpython-310/curl_cffi/requests copying curl_cffi/requests/headers.py -> build/lib.linux-aarch64-cpython-310/curl_cffi/requests copying curl_cffi/requests/cookies.py -> build/lib.linux-aarch64-cpython-310/curl_cffi/requests copying curl_cffi/requests/errors.py -> build/lib.linux-aarch64-cpython-310/curl_cffi/requests copying curl_cffi/requests/init.py -> build/lib.linux-aarch64-cpython-310/curl_cffi/requests running egg_info writing curl_cffi.egg-info/PKG-INFO writing dependency_links to curl_cffi.egg-info/dependency_links.txt writing requirements to curl_cffi.egg-info/requires.txt writing top-level names to curl_cffi.egg-info/top_level.txt reading manifest file 'curl_cffi.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'curl_cffi/cacert.pem' warning: no files found matching 'curl_cffi/_wrapper.' warning: no files found matching 'curl_cffi/include/curl/' adding license file 'LICENSE' writing manifest file 'curl_cffi.egg-info/SOURCES.txt' /tmp/pip-build-env-pd8gakyx/overlay/local/lib/python3.10/dist-packages/setuptools/command/build_py.py:201: _Warning: Package 'curl_cffi.ffi' is absent from the packages configuration. !!

          ********************************************************************************
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'curl_cffi.ffi' as an importable package[^1],
          but it is absent from setuptools' `packages` configuration.

          This leads to an ambiguous overall configuration. If you want to distribute this
          package, please make sure that 'curl_cffi.ffi' is explicitly added
          to the `packages` configuration field.

          Alternatively, you can also rely on setuptools' discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).

          You can read more about "package discovery" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

          If you don't want 'curl_cffi.ffi' to be distributed and are
          already explicitly excluding 'curl_cffi.ffi' via
          `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
          you can try to use `exclude_package_data`, or `include-package-data=False` in
          combination with a more fine grained `package-data` configuration.

          You can read more about "package data files" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/datafiles.html

          [^1]: For Python, any directory (with suitable naming) can be imported,
                even if it does not contain any `.py` files.
                On the other hand, currently there is no concept of package data
                directory, all directories are treated like packages.
          ********************************************************************************

  !!
    check.warn(importable)
  creating build/lib.linux-aarch64-cpython-310/curl_cffi/ffi
  copying curl_cffi/ffi/cdef.c -> build/lib.linux-aarch64-cpython-310/curl_cffi/ffi
  copying curl_cffi/ffi/shim.c -> build/lib.linux-aarch64-cpython-310/curl_cffi/ffi
  copying curl_cffi/ffi/shim.h -> build/lib.linux-aarch64-cpython-310/curl_cffi/ffi
  running build_ext
  generating cffi module 'build/temp.linux-aarch64-cpython-310/curl_cffi._wrapper.c'
  creating build/temp.linux-aarch64-cpython-310
  building 'curl_cffi._wrapper' extension
  creating build/temp.linux-aarch64-cpython-310/build
  creating build/temp.linux-aarch64-cpython-310/build/temp.linux-aarch64-cpython-310
  creating build/temp.linux-aarch64-cpython-310/curl_cffi
  creating build/temp.linux-aarch64-cpython-310/curl_cffi/ffi
  arm-linux-gnueabihf-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Icurl_cffi/include -Icurl_cffi/ffi -I/usr/include/python3.10 -c build/temp.linux-aarch64-cpython-310/curl_cffi._wrapper.c -o build/temp.linux-aarch64-cpython-310/build/temp.linux-aarch64-cpython-310/curl_cffi._wrapper.o
  In file included from build/temp.linux-aarch64-cpython-310/curl_cffi._wrapper.c:570:
  curl_cffi/ffi/shim.h:5:10: fatal error: curl/curl.h: No such file or directory
      5 | #include "curl/curl.h"
        |          ^~~~~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for curl-cffi Building wheel for frozenlist (pyproject.toml): started Building wheel for frozenlist (pyproject.toml): finished with status 'done' Created wheel for frozenlist: filename=frozenlist-1.4.0-cp310-cp310-linux_aarch64.whl size=178019 sha256=5d9410bfde5e1c631be91153038501d5261a9e830ab9d5305f8f27c01df2581b Stored in directory: /root/.cache/pip/wheels/eb/a7/12/2cb9ef690cc40fafe4d489c529352fd0438b4beddb104089fe Building wheel for multidict (pyproject.toml): started Building wheel for multidict (pyproject.toml): finished with status 'done' Created wheel for multidict: filename=multidict-6.0.4-cp310-cp310-linux_aarch64.whl size=110126 sha256=ed9b7feebccf5ebb7cbe84d5d91d37368a98f5e6d7ac069e44a6f3bc7afdd7b0 Stored in directory: /root/.cache/pip/wheels/d3/0f/ad/bd2376f99105cc211cfe25f50868fdbddedcf5bab5a699e47b Building wheel for yarl (pyproject.toml): started Building wheel for yarl (pyproject.toml): finished with status 'done' Created wheel for yarl: filename=yarl-1.9.2-cp310-cp310-linux_aarch64.whl size=211531 sha256=c4aa8d32a73085a6d8bfeda34422593d2121090dd054754e70b067fad9e40f74 Stored in directory: /root/.cache/pip/wheels/66/b6/b8/1a4ac9b4227cd4212504cc12bf9147c30534b8d5416233fc92 Successfully built aiohttp frozenlist multidict yarl Failed to build curl-cffi ERROR: Could not build wheels for curl-cffi, which is required to install pyproject.toml-based projects

[notice] A new release of pip is available: 23.1.2 -> 23.2.1 [notice] To update, run: python3 -m pip install --upgrade pip pip install result 1 plugin start/fork failed Traceback (most recent call last): File "/server/node_modules/@scrypted/server/python/plugin_remote.py", line 380, in loadZip return await self.loadZipWrapped(packageJson, zipData, options) File "/server/node_modules/@scrypted/server/python/plugin_remote.py", line 634, in loadZipWrapped raise Exception('non-zero result from pip %s' % result) Exception: non-zero result from pip 1

bjia56 commented 1 year ago

@nbeathoven it looks like you have a 64bit docker install running on a 32bit kernel. you probably want to undo the change to arm_64bit and set it to arm_64bit=1. or, purge your docker runtime (don't delete the scrypted data folder) and reinstall docker

nbeathoven commented 1 year ago

@nbeathoven it looks like you have a 64bit docker install running on a 32bit kernel. you probably want to undo the change to arm_64bit and set it to arm_64bit=1. or, purge your docker runtime (don't delete the scrypted data folder) and reinstall docker

@bjia56 in fact it was a typo in my entry. I set arm_64bit=0, reinstalled Scrypted and the entire Arlo Plugin 0.8.13 and now everything is compiling and working fine. Are you suggesting I can force the 64bit and should expect the same results?

bjia56 commented 1 year ago

If you've got it working then I wouldn't recommend touching it further. Ideally you should use a 64 bit OS on the RPi4, although I know some distros like HA only come in 32 bit, so in those cases it should be forced to 32 bit.

jlg89 commented 1 year ago

From what I've read, there's not really any performance benefit to 64-bit vs. 32-bit on RPi, at least at this point and given our typical usage, so unless you know for sure that you started with a clean 64-bit image and everything is built cleanly on top of that, force it to 32-bit and save yourself a lot of trouble.

koush commented 1 year ago

There is not much in the way of 32 bit linux wheels. And I imagine that situation will continue to get worse as python versions (and package version dependencies) increment. Scrypted will be based on the most recent LTS version of Linux, and that will continue upgrading the python version every release.