Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 721706 - media-libs/opencv-4.1.2-r3: Cannot load cv2 python package
Summary: media-libs/opencv-4.1.2-r3: Cannot load cv2 python package
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Amy Liffey
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-05-08 22:38 UTC by Stefan Huber
Modified: 2020-12-27 04:37 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Huber 2020-05-08 22:38:47 UTC
The command

% python3 -c "import cv2"

gives ModuleNotFoundError: No module named 'cv2' because the cv2 package is not installed at /usr/lib64, but rather

% qlist opencv | grep cv2/__init__
/usr/lib/python3.6/site-packages/cv2/__init__.py

Moving the directory cv2 under /usr/lib64 make cv2 work again.

Reproducible: Always
Comment 1 Stefan Huber 2020-05-08 22:56:19 UTC
After re-emerging it works with python-3.7 because in python-3.7 sys.path uses /usr/lib:

% python3.7 -c "import sys; print(sys.path)"
['', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/usr/lib/python3.7/site-packages']

but python-3.6 does not:

% python3.6 -c "import sys; print(sys.path)"
['', '/usr/lib64/python36.zip', '/usr/lib64/python3.6', '/usr/lib64/python3.6/lib-dynload', '/home/xxx/.local/lib64/python3.6/site-packages', '/usr/lib64/python3.6/site-packages']

By the way, cv2 is the only python package on my system installed to /usr/lib/python3.6/site-packages/.
Comment 2 Larry the Git Cow gentoo-dev 2020-12-27 04:34:11 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e402fc2e336e59a514557c6c1bdb014cb590fad1

commit e402fc2e336e59a514557c6c1bdb014cb590fad1
Author:     Ross Charles Campbell <rossbridger.cc@gmail.com>
AuthorDate: 2020-12-24 06:05:46 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2020-12-27 04:34:08 +0000

    media-libs/opencv: version bump, remove old
    
     - Added constraint on CPU flags on x86
    
     - Also closed out bugs that wasn't reported reproducible on newer versions
    
    Closes: https://bugs.gentoo.org/751781
    Closes: https://bugs.gentoo.org/703658
    Closes: https://bugs.gentoo.org/706040
    Closes: https://bugs.gentoo.org/721706
    Closes: https://bugs.gentoo.org/689838
    Package-Manager: Portage-3.0.12, Repoman-3.0.2
    Signed-off-by: Ross Charles Campbell <rossbridger.cc@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/18801
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/opencv/Manifest                         |  4 ++--
 ...{opencv-4.4.0-r1.ebuild => opencv-4.5.1.ebuild} | 26 +++++++++++++++-------
 2 files changed, 20 insertions(+), 10 deletions(-)