From 4b7842a737ff9b97abab083aa0d64c20c7d53c10 Mon Sep 17 00:00:00 2001 From: Jeff Moe Date: Sun, 31 Jul 2022 22:09:59 -0600 Subject: [PATCH] Just import picamerax if Pi is used --- README.md | 4 +++- acquire.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cae6cf7..12366a4 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ Get the latest TLEs: ``` -# Misc +# Fixed When running `acquire.py` on `amd64` architecture it gives this error: ``` @@ -117,6 +117,8 @@ That error comes from installing `picamerax` on `amd64`, which was added to env/lib/python3.10/site-packages/picamerax/bcm_host.py:_lib = ct.CDLL('libbcm_host.so') ``` +For now, just import the library that calls for that binary if the +Pi camera is used. No need to call it (and crash) if CV2 is used on non-Pi. # Upstream diff --git a/acquire.py b/acquire.py index ff8e7bb..9fd1293 100755 --- a/acquire.py +++ b/acquire.py @@ -15,12 +15,12 @@ import logging import configparser import argparse import zwoasi as asi -from picamerax.array import PiRGBArray -from picamerax import PiCamera # Capture images from pi def capture_pi(image_queue, z1, t1, z2, t2, nx, ny, nz, tend, device_id, live, cfg): + from picamerax.array import PiRGBArray + from picamerax import PiCamera # Intialization first = True slow_CPU = False