camera icon indicating copy to clipboard operation
camera copied to clipboard

No module named 'PySpin' & can't open camera by index

Open theofila opened this issue 3 years ago • 1 comments

Hey, I have two different type of issues. the first issue is, when I try to run python3 blackfly_display.py I get the following error: Traceback (most recent call last): File "blackfly_display.py", line 61, in <module> from camera.capture.blackflycapture import blackflyCapture File "/home/theofila/.local/lib/python3.6/site-packages/camera/capture/blackflycapture.py", line 23, in <module> import PySpin ModuleNotFoundError: No module named 'PySpin'

I am using ubuntu18.04 I don't know how to fix it.. I have SpinnView installed and I can open the camera with the Software I downloaded from the FLIR website..

My second Issue is that when I try to run: python3 capture_display.py I get : [ WARN:[email protected]] global /io/opencv/modules/videoio/src/cap_v4l.cpp (889) open VIDEOIO(V4L2:/dev/video0): can't open camera by index [ WARN:[email protected]] global /io/opencv/modules/videoio/src/cap_v4l.cpp (889) open VIDEOIO(V4L2:/dev/video1): can't open camera by index [ WARN:[email protected]] global /io/opencv/modules/videoio/src/cap_v4l.cpp (889) open VIDEOIO(V4L2:/dev/video2): can't open camera by index [ WARN:[email protected]] global /io/opencv/modules/videoio/src/cap_v4l.cpp (889) open VIDEOIO(V4L2:/dev/video3): can't open camera by index [ WARN:[email protected]] global /io/opencv/modules/videoio/src/cap_v4l.cpp (889) open VIDEOIO(V4L2:/dev/video4): can't open camera by index [ WARN:[email protected]] global /io/opencv/modules/videoio/src/cap_v4l.cpp (889) open VIDEOIO(V4L2:/dev/video0): can't open camera by index INFO:CV2Capture:Getting Images ^CTraceback (most recent call last): File "capture_display.py", line 134, in <module> (frame_time, frame) = camera.capture.get(block=True, timeout=None) File "/usr/lib/python3.6/queue.py", line 164, in get self.not_empty.wait() File "/usr/lib/python3.6/threading.py", line 295, in wait waiter.acquire() KeyboardInterrupt terminate called without an active exception Aborted (core dumped)

What can be the problem here? Ok it's clear, my camera is not recognized as a /dev/vid* but why?

theofila avatar Apr 19 '22 23:04 theofila

Likely you did not install the python bindings for the blackfly camera which you would need to download from the same place as where the spinview software is located. Unfortunately latest version of python that is supported is 3.8. python binding are not available for newer python version. You can install this on any computer with built-in camera or USB camera and try to view the camera with capture display.py. blackfly camera can not be viewed with regular capture_display and needs the blackfly_* python programs. When you have blackfly camera open in spinview you can not open it with an other program as it is in use.

uutzinger avatar Jun 14 '22 19:06 uutzinger