Build OpenCV using the script: GitHub - mdegans/nano_build_opencv: Build OpenCV on Nvidia Jetson Nano
The problem starts here because I think this script doesn’t support Python3.7.
After this script is run and when I execute Python3, trying to import cv2, I get this error: File , line1 in ModuleNotFoundError: No module named ‘cv2’
Why do I need Python3.7?
Because of the Adafruit libraries which are working only on Python3.7 and later.
Questions:
Is there some way to have Python3.7 and also OpenCV4.1 and other tools that work perfectly fine with Python3.6?
Am I doing something wrong in the process?
Can I make adafruit libraries work with Python3.6? I’ve tried specifying an old version of adafruit on Python3.6, but then it installs some other supporting packages which are of new version, and then when I try to import for example (servokit library), it doesn’t work.
Please help me, I’ve been working on this for many days, and trying to figure this one out, instead of actually learning JETSON NANO :)
Main cause of opencv failing to install for python3 is having opencv build set for python2 install (not sure why, but it is usual that it fails to install for both python2 and pyhton3).
You may try configuring and building/installing opencv such as here:
On top of this, install the old version: (it will uninstall new versions automatically)
sudo pip3 install
adafruit-circuitpython-busdevice==5.1.2
adafruit-circuitpython-motor==3.3.5
adafruit-circuitpython-pca9685==3.4.1
adafruit-circuitpython-register==1.9.8
adafruit-circuitpython-servokit==1.3.8
Adafruit-Blinka==6.11.1
Adafruit-GPIO==1.0.3
Adafruit-MotorHAT==1.4.0
Adafruit-PlatformDetect==3.19.6
Adafruit-PureIO==1.1.9
Adafruit-SSD1306==1.6.2
If you skip step#4, you will not be able to install these packages in step#5. Weird but not for me to question.
Now you will end up with working combination of:
python3.6
adafruit servo kit libraries
openCV 4.1
Verified and working OK.
Tip: took alot of experiments, so if you’re in a similar situation I would recommend using VIRTUAL ENVIRONMENT, so you dont have to go through cycles of flashing/reflashing image!