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

Example Error - Python is missing OpenCV #15

Open
JohannesBetz opened this issue May 30, 2018 · 2 comments
Open

Example Error - Python is missing OpenCV #15

JohannesBetz opened this issue May 30, 2018 · 2 comments

Comments

@JohannesBetz
Copy link

JohannesBetz commented May 30, 2018

Hello,

i did you installation tutorial as you said. But it seems like, my python doesnt know which OpenCV version to use.
When i try your Example, i get an error and the hint, that python is accessing openCV version 3.3.1
The error looks like this
Called with args: Namespace(video_device=0) OpenCV version: 3.3.1-dev ('Device Number:', 0) camera open failed
I think python doesnt know that i build openCV from source. I double checked in the terminal an i get these issues:

`nvidia@tegra-ubuntu:~/OpenCVTX2/Examples$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.

import cv
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named 'cv'
import cv2
Traceback (most recent call last):
File "", line 1, in
ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type
`
What have i done wrong in the build process?

@JohannesBetz JohannesBetz changed the title Example Example Error - Python is missing OpenCV May 30, 2018
@jetsonhacks
Copy link
Owner

It is using the PYTHONPATH which is set to the ROS 2.7 OpenCV version:

/opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so

ROS uses its own OpenCV library.

@joonr7
Copy link

joonr7 commented Nov 15, 2018

Easiest way: Remove ROS from your jetson. Then set the path of opencv.
If you don't want remove ROS, you have to separate non-ROS usage and ROS usage.

I believe you can control from your ~/.bashrc file.
There should be "source /opt/ros/{$ROS_DISTRO}/setup.bash" or something like that.

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