Comment 3 for bug 1510365

Revision history for this message
Park, JaeSuk (jspark99) wrote :

ubuntu 14.04]$ sudo aa-complain
Traceback (most recent call last):
  File "/usr/sbin/aa-complain", line 17, in <module>
    import apparmor.tools
ImportError: No module named apparmor.tools

I tried 2ways to install apparmor (apt-get case and 'make install' case)
For apt-get case, I found apparmor-python related .deb packages in /var/cache/apt/archives
and found python modules are installed in /usr/lib/python3/dist-packages/apparmor/tools.py

apparmor-profiles_2.8.95~2430-ubuntu5.3_all.deb
apparmor-utils_2.8.95~2430-0ubuntu5.1_i386.deb
python3-apparmor_2.8.95~2430-0ubuntu5.1_i386.deb
python3-libapparmor_2.8.95~2430-0ubuntu5.1_i386.deb

$ dpkg --contents python3-apparmor_2.8.95~2430-0ubuntu5.1_i386.deb
./usr/lib/python3/dist-packages/
./usr/lib/python3/dist-packages/apparmor/logparser.py

$ dpkg --contents python3-libapparmor_2.8.95~2430-0ubuntu5.1_i386.deb
./usr/lib/python3/dist-packages/LibAppArmor-2.8.95.egg-info
./usr/lib/python3/dist-packages/LibAppArmor/

For 'make install' case, /usr/lib/python2.7/site-packages/apparmor/tools.py
This seems to be cause of "Import Error: No module named apparmor.tools"
When I copied it manually to /usr/lib/python2.7/dist-packages/apparmor/tools.py, it worked ok
Apparmor/utils/python-tools-setup.py imports distutils.command.install.py and it copies to relevant paths.
So README file in apparmor source packages needs newer version.