0

I installed opencv version 4.1 following this guide. Looked like it completed fine, but when i test with:

import cv2 #this works
print(cv2.__version__) #but not this

I get an attributeerror: module 'cv2' has no attribute 'version'

This is on the jetson nano with jetpack

Yunus Temurlenk
  • 4,085
  • 4
  • 18
  • 39
vegiv
  • 124
  • 1
  • 9

2 Answers2

0

What version of jetpack are you using? I suggest Jetpack 4.4. it comes with opencv 4.1. You don't need to build it from source. Once you install Jetpack 4.4 Make sure you install dependencies for python3 "cv2"

$ sudo apt-get update
$ sudo apt-get install -y build-essential make cmake cmake-curses-gui
$ sudo apt-get install -y git g++ pkg-config curl libfreetype6-dev
$ sudo apt-get install -y libcanberra-gtk-module libcanberra-gtk3-module
$ sudo apt-get install -y python3-dev python3-testresources python3-pip
$ sudo pip3 install -U pip
$ cd ${HOME}/project/jetson_nano
$ ./install_protobuf-3.8.0.sh
$ sudo pip3 install numpy matplotlib

Test now.

Here is a full set up on Jetpack 4.2 including building opencv from source https://github.com/T-DevH/jetson-nano-tfdev (you won't need to do that with Jetpack 4.4)

Tarik007
  • 474
  • 1
  • 4
  • 14
  • thank you for answer. Fixed by removing opencv and do another build. Does the opencv 4 that comes with jetpack 4.4 have cuda support included? – vegiv Jul 13 '20 at 08:17
0

Fixed by removing opencv and do another build.

vegiv
  • 124
  • 1
  • 9