I'd finally installed OpenCV 4.1.0-dev in my raspberry pi with success,

I checked that in Terminal by :

pi@raspberrypi:~ $ python3
Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__

But then when I try to execute a python script inside Geany, the code doesn't get executed and I get an error says:

Traceback (most recent call last):
  File "car_detection.py", line 2, in <module>
    import cv2
ImportError: No module named 'cv2'

1- First, I tried sudo reboot and rebooted my raspi, it doesn't change anything.

2- I even searched for the settings to change the python interpreter in Geany.. but nothing, because Geany is a text editor. the only thing that I can make is to change (python)--> to (python3) because I was compiling and working with Python 3.

3- The last thing that I did is to delete my project and re-create a new one, but even this step I guess didn't make sense.

I wish anyone could help for giving a solution to this problem, Personally, for now, I'm working temporarily in Python3 (IDLE), it helps me, so I can execute my codes there and edit them perfectly. even those for OpenCV.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.