Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#23445 - [opencv] python interface not responding
Attached to Project:
Arch Linux
Opened by Lazarus (Lazarus) - Saturday, 26 March 2011, 02:32 GMT
Last edited by Ray Rashif (schivmeister) - Tuesday, 05 April 2011, 08:48 GMT
Opened by Lazarus (Lazarus) - Saturday, 26 March 2011, 02:32 GMT
Last edited by Ray Rashif (schivmeister) - Tuesday, 05 April 2011, 08:48 GMT
|
DetailsCurrently the package places only a "cv.so" file in the usr/lib/python2.7/site-packages directory, which unsurprisingly seems to be insufficient; I can "import cv", but nothing is imported except "__file__". I have python2-numpy installed.
Since the release of opencv2.2, python support has apparently been completely reworked and considerably improved, so I would appreciate it if this package be built in a way that allows me to use this functionality... Some instructions here: http://opencv.willowgarage.com/wiki/InstallGuide |
This task depends upon
Closed by Ray Rashif (schivmeister)
Tuesday, 05 April 2011, 08:48 GMT
Reason for closing: Works for me
Additional comments about closing: Reopen if necessary.
Tuesday, 05 April 2011, 08:48 GMT
Reason for closing: Works for me
Additional comments about closing: Reopen if necessary.
If you had grasped the meaning of my bug report, you'd notice I already did..
$ python2
Python 2.7.1 (r271:86832, Feb 21 2011, 01:28:26)
[GCC 4.5.2 20110127 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
['__builtins__', '__doc__', '__file__', '__name__', '__package__']
>>> cv.LoadImageM('test.jpg', 1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'LoadImageM'
>>>
Everything in the cookbooks you linked to result in an AttributeError such as the one above, because --I repeat-- importing cv with your package (on my machine at least) doesn't import any attributes of cv into the global namespace (attributes of the form __name__ are attributes of the python interpreter itself).
I very much appreciate that you went to considerable lengths to include python, but please verify that what you say worked before still works *now*, because --I repeat yet again-- the opencv python module has apparently been reworked since version 2.2.
[schiv@cq60 ~]$ pacman -Q opencv python2
opencv 2.2.0-3
python2 2.7.1-7
[schiv@cq60 ~]$ python2
Python 2.7.1 (r271:86832, Feb 21 2011, 01:26:25)
[GCC 4.5.2 20110127 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
>>> cv.LoadImageM('openshot.png', 1)
<cvmat(type=42424010 8UC3 rows=768 cols=1366 step=4098 )>
You are now going to follow my lead and verify this for yourself, before you accuse me again of incompetence in that tone:
# pacman -S devtools
# extra-i686-build
# cd /var/tmp/archbuild/extra-i686/root
# cp /etc/resolv.conf etc/
# cp $imgdir/test.jpg .
# rm /var/cache/pacman/pkg/{opencv,python2}*
# mount -o bind /var/cache/pacman/pkg var/cache/pacman/pkg
# chroot .
# pacman -Syu opencv python2-numpy
# python2
# import cv
# cv.LoadImageM('test.jpg', 1)
After you're done looking at the result:
# CTRL+D
# exit
# umount var/cache/pacman/pkg
# rm /etc/resolv.conf *.jpg
By now, I could close this as not being a bug and blame this on your system - but I won't be that arrogant. Instead, we're going to troubleshoot this if you're keen and patient:
1) pacman -Qlq opencv > opencv.pkglist
2) pacman -Syu python2 opencv
3) try
4) pacman -U the package at http://pkgbuild.com/~schiv/
5) try
6) rebuild opencv from ABS
7) try
8) report back here the results of (3), (5), (7) and attachment (1)
Btw, you find it suspicious that there is only a single python library, but:
* single import of all of OpenCV using "import cv"
From: http://opencv.willowgarage.com/wiki/PythonInterface
If you think that is insufficient, show us a filelist which you know to be sufficient (ask upstream; other distros).
Then, again I was wrong in assuming that this package misses files in site-packages. SORRY ABOUT THAT.
In the chroot you described above, "import cv" does work correctly though ("dir(cv)" results in all the attributes being listed). Great.
However, it doesn't work in my real environment, even after going through hoops 1 to 8. Can't think of any other cause than that some package installed on my system conflicts with this one. Trying to narrow the culprit down by mimicking my real environment inside said chroot, but no luck so far...
Thank you for your kind help.
Right, install all the packages you have (instead of the foreign ones) to the chroot. You could also search and destroy previously self-made symlinks, foreign (non-package) libraries and libtool files in the system, but that would be tedious.
Sorry, it should've read:
pacman -Qlq opencv > opencv.pkglist
Please reinstall the base group like so:
pacman -S base
Make sure you're not using [testing], and reboot if possible. The final (desperate) solution would be this:
Reinstall Arch.
But of course, you only need access to another Linux system (not reinstall as in from a CD). From there, remove all packages except pacman and deps (backup the entire system package list if you want), remove leftovers in the system paths that do not look like they belong, then reinstall everything. You will need to follow https://wiki.archlinux.org/index.php/Install_From_Existing_Linux if you find yourself losing pacman/glibc/gcc-libs along the way.
Anyway, after rebooting or killing all python instances I can import cv successfully (at least sometimes...), so I think I can conclude that this problem is not caused by cv, so perhaps this bug report should be closed.
...sorry for the trouble.