EbenKouao / pi-camera-stream-flask

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

from .cv2 import * ImportError: numpy.core.multiarray failed to import >>> #13

Open BernardNyarko opened 3 years ago

BernardNyarko commented 3 years ago

Hi Eben, thanks for the video on how to make a remote viewable camera with raspberry pi (Beginner project). However, I've been having issues running the main.py as it keeps giving me an error with regards to numpy. I've uninstalled and installed different versions of numpy to no avail. can you please help?. I get the same error when I run the code for camera.py. Below is the error I receive when I run the main.py code.

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

BernardNyarko commented 3 years ago

Don't bother Eben, I just got it fixed. The command "pip3 install --upgrade numpy" did the trick.

BjoernLuig commented 3 years ago

I got exactly the same problem but "pip3 install --upgrade numpy" didn't fix it. Any ideas?

Edit: I changed sudo python3 /home/pi/pi-camera-stream-flask/main.py to python3 /home/pi/pi-camera-stream-flask/main.py and now it works.

BernardNyarko commented 3 years ago

Sorry about that. If it didn't work then I don't know of any other solutions to the problem.

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon Virus-free. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Sep 4, 2021 at 7:39 AM Björn Luig @.***> wrote:

I got exactly the same problem but "pip3 install --upgrade numpy" didn't fix it. Any ideas?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/EbenKouao/pi-camera-stream-flask/issues/13#issuecomment-912967585, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARVVQ5ORBTZVO43SWAS3YQLUAIHOTANCNFSM5CXES6SA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

nbosio1001 commented 1 year ago

Why is this project missing a requirements.txt file?