Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BernardNyarko opened this issue Aug 24, 2021 · 4 comments

Comments

@BernardNyarko
Copy link

BernardNyarko commented Aug 24, 2021

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
Copy link
Author

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

@BjoernLuig
Copy link

BjoernLuig commented Sep 4, 2021

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.

BjoernLuig added a commit to BjoernLuig/pi-camera-stream-flask that referenced this issue Sep 4, 2021
Fixed issue EbenKouao#13 by removing sudo. Please check if it still works on other settups.
@BernardNyarko
Copy link
Author

BernardNyarko commented Sep 9, 2021 via email

@nbosio1001
Copy link

Why is this project missing a requirements.txt file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants