Opencv woes

So I got my Nano in a bad state here and need some advice. I tried to add some simple cv2 operations on detection, drawing my own detection boxes. I got a runtime error calling cvtColor as described here:

[jetson-inference/ at master · dusty-nv/jetson-inference · GitHub]

So I used pip to install opencv-python again, thinking I was missing something. But now I get an Illegal Instruction (core dumped) error when I try to run my python detection code.

Hi @brking, I believe this is issue with numpy. Try running export OPENBLAS_CORETYPE=ARMV8 first.

For more info, see: Illegal instruction (core dumped) on import for numpy 1.19.5 on ARM64 · Issue #18131 · numpy/numpy · GitHub

I ended up re-imaging my SSD. Not sure what happened but I think I don’t know enough about installing external python packages on this system. For example pip isn’t installed, so I installed pip, but with python 2 and 3 both installed it’s confusing. And I used sudo to install some packages which I guess is a no-no. Anyway, with the re-image, and not using sudo to install boto3 and requests, cv2 seems to work now.

OK, glad that you got it working. BTW pip refers to pip for Python 2.7, while pip3 refers to pip for Python 3.6. Since Python 2.7 is EOL, pip3 is almost exclusively used now. pip3 shouldn’t typically need sudo and can use the --user option instead.