All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Lautrbach <plautrba@redhat.com>
To: "selinux\@vger.kernel.org" <selinux@vger.kernel.org>
Subject: ImportError: cannot import name '_selinux' from 'selinux' with swig-4.0.0
Date: Thu, 16 May 2019 17:37:51 +0200	[thread overview]
Message-ID: <pjdr28yxve8.fsf@redhat.com> (raw)

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

                 reply	other threads:[~2019-05-16 15:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pjdr28yxve8.fsf@redhat.com \
    --to=plautrba@redhat.com \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.