[apparmor] [Question] Apparmor running on Python2.7 only?

Jae Suk Park jspark99 at gmail.com
Sat Nov 14 22:59:24 UTC 2015


"export PYTHON=/usr/bin/python2.7" didn't work for my environment, though
my environment is not special (get Ubuntu 12.04LTS from ubuntu.com and bzr
co lp:apparmor --rev 2434)


Also "export PYTHONPATH='/usr/lib/python2.7/site-packages/:
/usr/lib/python2.7/site-packages/apparmor:/usr/lib/python2.7/site-packages/LibAppArmor'
"  didn't work


BUT I was encouraged by your comment "It should, though there may be
bugs..."

I added 4 lines in aa-complain, aa-enforce before "import apparmor.tools"

import sys

sys.path.append('/usr/lib/python2.7/site-packages/')
sys.path.append('/usr/lib/python2.7/site-packages/apparmor')
sys.path.append('/usr/lib/python2.7/site-packages/LibAppArmor')


(https://bugs.launchpad.net/apparmor/+bug/1510365)
And this error "No moudle named apparmor.tools" disappeared.
> 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


"export PYTHON and PYTHONPATH not working issue" still remains, I couldn't
find solution.


Thanks


-----Original Message-----
*From:* "Seth Arnold"<seth.arnold at canonical.com>
*To:* <apparmor at lists.ubuntu.com>;
*Cc:*
*Sent:* 2015-11-13 (금) 05:58:16
*Subject:* Re: [apparmor] [Question] Apparmor running on Python2.7 only?

On Mon, Nov 09, 2015 at 01:20:38PM +0900, Jae Suk Park wrote:
> Can Apparmor run on python 2.7 environment only?

It should, though there may be bugs that prevent all features
from working. If you don't need aa-logprof, aa-genprof, aa-enforce,
aa-status, etc. in your environments, you don't even need any of the
python tools. What are you going to be doing in the yocto environments? Do
you need the higher-level tools at all?

> 3. but when I try to install apparmor ubuntu package, libpython3 related
> pacakages is installed
> [...]
> 4. I guess Apparmor package is deeply dependent on python3.

The apparmor builds in Ubuntu are dependent on python3 because it seems
most useful for our users. From the wily buildlogs[1]:

| # Build pythons
| for py in python2.7 python3.4 python3.5 ; do \
| cp -a /«PKGBUILDDIR»/libraries/libapparmor
/«PKGBUILDDIR»/libraries/libapparmor.$py
&& \
| PYTHON=/usr/bin/$py dh_auto_configure \
| -D libraries/libapparmor.$py -- --with-python && \
| PYTHON=/usr/bin/$py dh_auto_build \
| -D libraries/libapparmor.$py; \
| done

When you're building the libraries, try setting the PYTHON environment
variable to the path of your python interpreter, as done above. (Ignore
the rest of the dh_auto_* stuff, the important part is the PYTHON
environment variable before calling configure.)

Thanks

1:
https://launchpadlibrarian.net/216283862/buildlog_ubuntu-wily-amd64.apparmor_2.10-0ubuntu6_BUILDING.txt.gz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20151115/055685bc/attachment.html>


More information about the AppArmor mailing list