Ask Your Question
0

latest opencv bindings for python3 goes to an unknown python directory on Ubuntu

asked 2018-12-06 09:08:15 -0600

swiss_knight gravatar image

updated 2018-12-06 09:08:57 -0600

Issue description:

When using cmake-gui on Ubuntu to build the latest 'master' opencv from git, the Python binding cv2.cpython-36m-x86_64-linux-gnu.so goes to a funky directory: /usr/local/python/cv2/
instead of: /usr/local/lib/python3.6/dist-packages/.

I haven't found where in cmake-gui we can change this? The only path available is: PYTHON3_PACKAGES_PATH which in my case was set to lib/python3.6/dist-packages relative to /usr/local of course.

So, it should have end up in the correct directory, I don't know why it doesn't.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-12-06 09:27:53 -0600

berak gravatar image

a known issue. quoting from here:

There are these options:

Don't install this loader package (it is mostly for standalone distributions): #12977 (comment)

Old behavior can restored via these CMake variables:

OPENCV_SKIP_PYTHON_LOADER=ON
OPENCV_PYTHON3_INSTALL_PATH=...site/dist-packages location... (not required since #13254)

setup.py is not complete for now and its usage is very limited (it is a bit tricky to install native binaries with their dependencies in Python). Try to install this loader in develop mode instead:

python3 setup.py develop
or
pip install -e .
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-12-06 09:08:15 -0600

Seen: 1,230 times

Last updated: Dec 06 '18