* ImportError: cannot import name '_selinux' from 'selinux' with swig-4.0.0
@ 2019-05-16 15:37 Petr Lautrbach
0 siblings, 0 replies; only message in thread
From: Petr Lautrbach @ 2019-05-16 15:37 UTC (permalink / raw)
To: selinux
Hello all,
selinux python module can't be imported when it's built using
swig-4.0.0:
>>> import selinux
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python3.7/site-packages/selinux/__init__.py",
line 13, in <module>
from . import _selinux
ImportError: cannot import name '_selinux' from 'selinux'
(/usr/lib64/python3.7/site-packages/selinux/__init__.py)
>>>
You can see it at [1]
The reason is that swig changed the way how it generates
__init__.py.
Now it uses:
from . import _selinux
I've started to rewrite libselinux in order not to build and
install
python bindings manually, but to use python distutils [2]. It
still fails
on travis but I was able to built it and use it on my local
rawhide machine.
[1]
https://groups.google.com/forum/#!topic/kernel-secnext/rGZxB39atVQ
[2]
https://github.com/bachradsusi/SELinuxProject-selinux/commits/swig-use-python-distutils
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-05-16 15:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16 15:37 ImportError: cannot import name '_selinux' from 'selinux' with swig-4.0.0 Petr Lautrbach
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.