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

ImportError #12

Open
huliosz1 opened this issue Aug 16, 2021 · 2 comments
Open

ImportError #12

huliosz1 opened this issue Aug 16, 2021 · 2 comments

Comments

@huliosz1
Copy link

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

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

@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)

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