EbenKouao / pi-camera-stream-flask

Create your own live camera stream using a Raspberry Pi 4
MIT License
320 stars 126 forks source link

ImportError #12

Open huliosz1 opened 3 years ago

huliosz1 commented 3 years ago

Hi. im trying to compiling the codes 'Main and Camera' and im getting the following errors:

Camera error: \ Python 3.7.3 (/usr/bin/python3)

%Run camera.py RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd Traceback (most recent call last): File "/home/pi/pi-camera-stream-flask/camera.py", line 5, in import cv2 File "/usr/local/lib/python3.7/dist-packages/cv2/init.py", line 5, in from .cv2 import * ImportError: numpy.core.multiarray failed to import

Main error: \ Python 3.7.3 (/usr/bin/python3)

%Run main.py RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd Traceback (most recent call last): File "/home/pi/pi-camera-stream-flask/main.py", line 7, in from camera import VideoCamera File "/home/pi/pi-camera-stream-flask/camera.py", line 5, in import cv2 File "/usr/local/lib/python3.7/dist-packages/cv2/init.py", line 5, in from .cv2 import * ImportError: numpy.core.multiarray failed to import

Any ideas Please?

harryraturi commented 3 years ago

@huliosz1 I've faced same issue so could you try to run main.py without sudo and it's work for me.

Here is the command: pi@raspberrypi:~ $ python3 /home/pi/pi-camera-stream-flask/main.py

panyijing1997 commented 2 years ago

@huliosz1 I've faced same issue so could you try to run main.py without sudo and it's work for me.

Here is the command: pi@raspberrypi:~ $ python3 /home/pi/pi-camera-stream-flask/main.py

Thanks, I have been faced with the same issue and runing without sudo works for me as well (after I upgrade NumPy to the newest version)