pip and python packages without info
Hi, I am installing (as user) some software via pip3. I noticed that it also installs some of the requirements into my private folder where I *do* have the respective software installed system-wide. In this case, notably the opencv package for python: speedy:~% rpm -q python3-opencv python3-opencv-4.5.0-3.19.x86_64 but speedy:~% pip3 list|grep cv speedy:~% So pip doesn't see that it is installed, and therefore downloads and installs a private version. I noticed that most python packages come with some egg-info, either a file or a directory. The opencv package doesn't have that. Is this the reason pip does not see the package? And if so, would this be a packaging error that asks for a bug report? Any other recommendations how to handle this? Right now I do a 'pip uninstall opencv-python' to get rid of the additional one... This is an oS Tumbleweed 20201228
On 1/5/21 1:14 AM, Peter Suetterlin wrote:
Hi,
I am installing (as user) some software via pip3. I noticed that it also installs some of the requirements into my private folder where I *do* have the respective software installed system-wide. In this case, notably the opencv package for python:
speedy:~% rpm -q python3-opencv python3-opencv-4.5.0-3.19.x86_64
but
speedy:~% pip3 list|grep cv speedy:~%
So pip doesn't see that it is installed, and therefore downloads and installs a private version. I noticed that most python packages come with some egg-info, either a file or a directory. The opencv package doesn't have that. Is this the reason pip does not see the package? And if so, would this be a packaging error that asks for a bug report?
Probably not, if the package works with "Build Requires:" / Requires in openSUSE packages it is probably ok, it likely doesn't provide those files because it is built as bindings as part of the opencv package rather then on its own. I think this is pretty common for such libraries (ie stuff thats a python wrapper around C)
Any other recommendations how to handle this? Right now I do a 'pip uninstall opencv-python' to get rid of the additional one...
Generally we recommend either using everything from pip or everything from packages rather then trying to mix and match. I don't know how opencv handles pip with respect to the fact it needs the matching C libs so from that perspective it may not work that well in this case. On the other hand python packages are pretty easy to do so if you are only missing one to two packages so if you'd like some help creating some additional packages let me know and I can point you in the right direction and assist you as needed. -- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adelaide Australia, UTC+10:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B
Simon Lees wrote:
On 1/5/21 1:14 AM, Peter Suetterlin wrote:
speedy:~% pip3 list|grep cv speedy:~%
So pip doesn't see that it is installed, and therefore downloads and installs a private version. I noticed that most python packages come with some egg-info, either a file or a directory. The opencv package doesn't have that. Is this the reason pip does not see the package? And if so, would this be a packaging error that asks for a bug report?
Probably not, if the package works with "Build Requires:" / Requires in openSUSE packages it is probably ok, it likely doesn't provide those files because it is built as bindings as part of the opencv package rather then on its own. I think this is pretty common for such libraries (ie stuff thats a python wrapper around C)
Yes, I noticed there are both (C-based) packages that have this egg-info, and others that don't (E.g., python3-kiwisolver has that info, others don't) So I was not sure if it's mandatory to have those, and if missing info is a bug. Obviously not.
Any other recommendations how to handle this? Right now I do a 'pip uninstall opencv-python' to get rid of the additional one...
Generally we recommend either using everything from pip or everything from packages rather then trying to mix and match.
Yes, that is why I don't use pip as root, only as user. I want to keep the main system clean and in sync.
I don't know how opencv handles pip with respect to the fact it needs the matching C libs so from that perspective it may not work that well in this case.
Actually, they handle it bad. Because the version installed by pip contains .so files that don't work on my TW system, and I read reports it neither works on recent Fedora.... :(
On the other hand python packages are pretty easy to do so if you are only missing one to two packages so if you'd like some help creating some additional packages let me know and I can point you in the right direction and assist you as needed.
I did have a look at the spec file of some other TW python package to figure out how to rpmbuild my own package (I'm doing that for several projects, but all are (c)make based). If there is some tutorial page what is needed for python, I'd indeed appreciate a pointer! Thanks for your help/time!
participants (2)
-
Peter Suetterlin
-
Simon Lees