[Rpm-maint] Python bindings: ModuleNotFoundError on custom prefix

Jun Aruga jaruga at redhat.com
Mon Sep 11 15:31:02 UTC 2017


Hello,

Though it might be basic thing,
when I built latest master branch's source with ./configure --prefix, then
I did import the Python bindings, I got ModuleNotFoundError.

Could you tell me how to import it?

Thanks.


Below steps are what I did.

$ pwd
/home/jaruga/git/rpm

$ ./autogen.sh --noconfigure

$ ./configure --prefix="$(pwd)/dest"

$ make

$ make install

$ ls dest/
bin/  include/  lib/  share/  var/

$ cd python/

$ python3 -m venv ./venv

(venv) $ python setup.py build

(venv) $ python setup.py install

(venv) $ pip list
Package    Version
---------- -------
pip        9.0.1
rpm        4.14.90
setuptools 28.8.0

(venv) $ python -c 'import rpm'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/jaruga/git/rpm/python/rpm/__init__.py", line 38, in <module>
    from rpm._rpm import *
ModuleNotFoundError: No module named 'rpm._rpm'

(venv) $ python -c 'import sys; print(sys.path)'
['', '/usr/local/python-3.6.1/lib/python36.zip',
'/usr/local/python-3.6.1/lib/python3.6',
'/usr/local/python-3.6.1/lib/python3.6/lib-dynload',
'/home/jaruga/git/rpm/python/venv/lib/python3.6/site-packages']

(venv) $ ls venv/lib/python3.6/site-packages/rpm/ | sort
__pycache__/
_rpm.cpython-36m-x86_64-linux-gnu.so*
_rpmb.cpython-36m-x86_64-linux-gnu.so*
_rpms.cpython-36m-x86_64-linux-gnu.so*
__init__.py
transaction.py


--
Jun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20170911/9d322bf8/attachment.html>


More information about the Rpm-maint mailing list