Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 594238 - sys-libs/libapparmor[python] with dev-lang/swig-3.0.10 - ImportError: No module named '_LibAppArmor'
Summary: sys-libs/libapparmor[python] with dev-lang/swig-3.0.10 - ImportError: No modu...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michael Palimaka (kensington)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-18 15:12 UTC by Amadeusz Żołnowski (RETIRED)
Modified: 2016-11-13 11:59 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Amadeusz Żołnowski (RETIRED) gentoo-dev 2016-09-18 15:12:54 UTC
# aa-enforce firejail-default
Traceback (most recent call last):
  File "/usr/lib64/python3.4/site-packages/LibAppArmor/__init__.py", line 18, in swig_import_helper
    return importlib.import_module(mname)
  File "/usr/lib64/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked
ImportError: No module named '_LibAppArmor'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.4/aa-enforce", line 17, in <module>
    import apparmor.tools
  File "/usr/lib64/python3.4/site-packages/apparmor/tools.py", line 17, in <module>
    import apparmor.aa as apparmor
  File "/usr/lib64/python3.4/site-packages/apparmor/aa.py", line 29, in <module>
    import apparmor.logparser
  File "/usr/lib64/python3.4/site-packages/apparmor/logparser.py", line 19, in <module>
    import LibAppArmor
  File "/usr/lib64/python3.4/site-packages/LibAppArmor/__init__.py", line 21, in <module>
    _LibAppArmor = swig_import_helper()
  File "/usr/lib64/python3.4/site-packages/LibAppArmor/__init__.py", line 20, in swig_import_helper
    return importlib.import_module('_LibAppArmor')
  File "/usr/lib64/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_LibAppArmor'


Following instructions below fixed the problem for me:

    # cd /usr/lib64/python3.4/site-packages
    # ln -s LibAppArmor/_LibAppArmor.cpython-34m.so
Comment 1 Amadeusz Żołnowski (RETIRED) gentoo-dev 2016-09-18 15:14:51 UTC
Instruction above fixing the problem are taken from https://aur.archlinux.org/packages/apparmor/
Comment 2 Michael Palimaka (kensington) gentoo-dev 2016-09-21 17:22:39 UTC
Which version of dev-lang/swig do you have?
Comment 3 Amadeusz Żołnowski (RETIRED) gentoo-dev 2016-09-21 19:03:19 UTC
3.0.10
Comment 4 Michael Palimaka (kensington) gentoo-dev 2016-09-24 17:56:24 UTC
Thanks, fixed in git.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4930a1eb1971a0b1fde5b556d9e58104cc5a1176