[libvirt] libvirt-python RPM installation not recognized by pip

Daniel P. Berrange berrange at redhat.com
Mon May 15 13:00:13 UTC 2017


On Mon, May 15, 2017 at 02:52:07PM +0200, Martin Kletzander wrote:
> On Mon, May 15, 2017 at 07:35:30AM -0400, Cleber Rosa wrote:
> > Hello,
> > 
> > When using the standard "requirements.txt" files for installation
> > package dependencies, I noticed that "libvirt-python" would attempt to
> > be installed by "pip" even when the equivalent RPM package is already
> > installed.
> > 
> > For instance, on a Fedora 25 system:
> > 
> >  $ rpm -q libvirt-python
> >  libvirt-python-2.2.0-1.fc25.x86_64
> >  $ python -e 'import pkg_resources;
> > pkg_resources.get_distribution("libvirt-python")'
> >  ...
> > pkg_resources.DistributionNotFound: The 'libvirt-python' distribution
> > was not found and is required by the application
> > 
> > The provider (the actual module) is actually present, but (rightfully
> > so) under the name "libvirt":
> > 
> >  $ python -c 'import pkg_resources; print
> > pkg_resources.get_provider("libvirt")'
> > <pkg_resources.DefaultProvider instance at 0x7fdfbc67a488>
> > 
> > At first sight, this seems to be caused by the lack of an "egg-info"
> > file, such as:
> > 
> > $PYTHON_SITE_PACKAGES/libvirt_python-2.2.0-py2.7.egg-info
> > 
> > I'm reporting a supposedly packaging issue here since the libvirt-python
> > setup.py file itself includes support for a custom rpm command.
> > 
> > Please advise if any of this is intentional, and/or whether this should
> > indeed be reported here or on downstream only.
> > 
> 
> On non-rpm system, I have that file and it works properly:
> 
>  $ ls /usr/lib64/python*/site-packages/libvirt_python-3.2.0-py*.egg-info
>  /usr/lib64/python2.7/site-packages/libvirt_python-3.2.0-py2.7.egg-info
>  /usr/lib64/python3.4/site-packages/libvirt_python-3.2.0-py3.4.egg-info
> 
>  $ pip install --user libvirt-python
>  Requirement already satisfied: libvirt-python in /usr/lib64/python3.4/site-packages
> 
> Looks like this _might_ be related to the %install script in libvirt-python.spec.in:
> 
>  rm -f %{buildroot}%{_libdir}/python*/site-packages/*egg-info
> 
> So it should be included instead, I guess.  Cc'ing the original author
> for confirmation that it was not intentional.

Fedora policy for a long time was that python packages *should* delete
the *egg-info metadata files, but this has apparently changed so that it
should be kept installed.

https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/FOG5APDRQVNXR5ZOZZSVDNZVN4WURKG4/

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list