<div dir="ltr"><p style="margin-top:0px;margin-bottom:0px;font-size:10pt;font-family:Gulim,AppleGothic,sans-serif;padding:0px 0px 0px 10pt">"export PYTHON=/usr/bin/python2.7" didn't work for my environment, though my environment is not special (get Ubuntu 12.04LTS from <a href="http://ubuntu.com">ubuntu.com</a> and bzr co lp:apparmor --rev 2434)</p><p style="margin-top:0px;margin-bottom:0px;font-size:10pt;font-family:Gulim,AppleGothic,sans-serif;padding:0px 0px 0px 10pt"><br></p><p style="margin-top:0px;margin-bottom:0px;font-size:10pt;font-family:Gulim,AppleGothic,sans-serif;padding:0px 0px 0px 10pt">Also "export PYTHONPATH='/usr/lib/python2.7/site-packages/:<span style="font-size:13.3333px">/usr/lib/python2.7/site-packages/apparmor:</span><span style="font-size:13.3333px">/usr/lib/python2.7/site-packages/LibAppArmor' "  didn't work</span></p><p style="margin-top:0px;margin-bottom:0px;font-size:10pt;font-family:Gulim,AppleGothic,sans-serif;padding:0px 0px 0px 10pt"><span style="font-size:13.3333px"><br></span></p><p style="margin-top:0px;margin-bottom:0px;font-size:10pt;font-family:Gulim,AppleGothic,sans-serif;padding:0px 0px 0px 10pt"><span style="font-size:13.3333px">BUT I was encouraged by your comment "It should, though there may be bugs..." </span></p><p style="margin-top:0px;margin-bottom:0px;font-size:10pt;font-family:Gulim,AppleGothic,sans-serif;padding:0px 0px 0px 10pt">I added 4 lines in aa-complain, aa-enforce before "import apparmor.tools"</p><p style="margin-top:0px;margin-bottom:0px;font-size:10pt;font-family:Gulim,AppleGothic,sans-serif;padding:0px 0px 0px 10pt">import sys</p><p style="margin-top:0px;margin-bottom:0px;font-size:10pt;font-family:Gulim,AppleGothic,sans-serif;padding:0px 0px 0px 10pt"><span style="font-size:13.3333px">sys.path.append('</span><span style="font-size:13.3333px">/</span><span style="font-size:13.3333px">usr/lib/python2.7/site-packages/')<br></span><span style="font-size:13.3333px">sys.path.append('</span><span style="font-size:13.3333px">/</span><span style="font-size:13.3333px">usr/lib/python2.7/site-packages/apparmor')<br></span><span style="font-size:13.3333px">sys.path.append('</span><span style="font-size:13.3333px">/</span><span style="font-size:13.3333px">usr/lib/python2.7/site-packages/LibAppArmor')<br></span><span style="font-size:13.3333px"><br></span><br><span style="font-family:돋움,Dotum,Helvetica,'Apple SD Gothic Neo',sans-serif;font-size:12px;color:rgb(0,0,0);line-height:18px">(</span><font color="#000000" face="돋움, Dotum, Helvetica, Apple SD Gothic Neo, sans-serif" style="font-size:small"><span style="font-size:12px;line-height:18px"><a href="https://bugs.launchpad.net/apparmor/+bug/1510365">https://bugs.launchpad.net/apparmor/+bug/1510365</a>)<br></span></font>And this error "No moudle named apparmor.tools" disappeared.<br><span style="color:rgb(0,0,0);font-family:돋움,Dotum,Helvetica,'Apple SD Gothic Neo',sans-serif;font-size:12px;line-height:18px">> ubuntu 14.04]$ sudo aa-complain</span><br style="color:rgb(0,0,0);font-family:돋움,Dotum,Helvetica,'Apple SD Gothic Neo',sans-serif;font-size:12px;line-height:18px"><span style="color:rgb(0,0,0);font-family:돋움,Dotum,Helvetica,'Apple SD Gothic Neo',sans-serif;font-size:12px;line-height:18px">> Traceback (most recent call last):</span><br style="color:rgb(0,0,0);font-family:돋움,Dotum,Helvetica,'Apple SD Gothic Neo',sans-serif;font-size:12px;line-height:18px"><span style="color:rgb(0,0,0);font-family:돋움,Dotum,Helvetica,'Apple SD Gothic Neo',sans-serif;font-size:12px;line-height:18px">>   File "/usr/sbin/aa-complain", line 17, in <module></span><br style="color:rgb(0,0,0);font-family:돋움,Dotum,Helvetica,'Apple SD Gothic Neo',sans-serif;font-size:12px;line-height:18px"><span style="color:rgb(0,0,0);font-family:돋움,Dotum,Helvetica,'Apple SD Gothic Neo',sans-serif;font-size:12px;line-height:18px">>     import apparmor.tools</span><br style="color:rgb(0,0,0);font-family:돋움,Dotum,Helvetica,'Apple SD Gothic Neo',sans-serif;font-size:12px;line-height:18px"><span style="color:rgb(0,0,0);font-family:돋움,Dotum,Helvetica,'Apple SD Gothic Neo',sans-serif;font-size:12px;line-height:18px">> ImportError: No module named apparmor.tools</span><br></p><p style="margin-top:0px;margin-bottom:0px;font-size:10pt;font-family:Gulim,AppleGothic,sans-serif;padding:0px 0px 0px 10pt"><span style="color:rgb(0,0,0);font-family:돋움,Dotum,Helvetica,'Apple SD Gothic Neo',sans-serif;font-size:12px;line-height:18px"><br></span></p><p style="margin-top:0px;margin-bottom:0px;padding:0px 0px 0px 10pt"><span style="color:rgb(0,0,0);font-family:돋움,Dotum,Helvetica,'Apple SD Gothic Neo',sans-serif;font-size:12px;line-height:18px">"export PYTHON and PYTHONPATH not working issue" still remains, I couldn't find solution.</span></p><p style="margin-top:0px;margin-bottom:0px;padding:0px 0px 0px 10pt"><br></p><p style="margin-top:0px;margin-bottom:0px;padding:0px 0px 0px 10pt"><font color="#000000" face="돋움, Dotum, Helvetica, Apple SD Gothic Neo, sans-serif"><span style="font-size:12px;line-height:18px">Thanks</span></font></p><p style="margin-top:0px;margin-bottom:0px;font-size:10pt;font-family:Gulim,AppleGothic,sans-serif;padding:0px 0px 0px 10pt"><br></p><p style="margin-top:0px;margin-bottom:0px;font-size:10pt;font-family:Gulim,AppleGothic,sans-serif;padding:0px 0px 0px 10pt">-----Original Message-----<br><b>From:</b> "Seth Arnold"<<a href="mailto:seth.arnold@canonical.com" target="_blank">seth.arnold@canonical.com</a>> <br><b>To:</b> <<a href="mailto:apparmor@lists.ubuntu.com" target="_blank">apparmor@lists.ubuntu.com</a>>; <br><b>Cc:</b> <br><b>Sent:</b> 2015-11-13 (금) 05:58:16<br><b>Subject:</b> Re: [apparmor] [Question] Apparmor running on Python2.7 only?<br> </p><span class="im" style="font-family:Gulim;font-size:13.3333px">On Mon, Nov 09, 2015 at 01:20:38PM +0900, Jae Suk Park wrote: <br>> Can Apparmor run on python 2.7 environment only? <br><br></span><span style="font-family:Gulim;font-size:13.3333px">It should, though there may be bugs that prevent all features </span><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">from working. If you don't need aa-logprof, aa-genprof, aa-enforce, </span><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">aa-status, etc. in your environments, you don't even need any of the </span><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">python tools. What are you going to be doing in the yocto environments? Do </span><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">you need the higher-level tools at all? </span><br style="font-family:Gulim;font-size:13.3333px"><span class="im" style="font-family:Gulim;font-size:13.3333px"><br>> 3. but when I try to install apparmor ubuntu package, libpython3 related <br>> pacakages is installed <br></span><span style="font-family:Gulim;font-size:13.3333px">> [...] </span><br style="font-family:Gulim;font-size:13.3333px"><span class="im" style="font-family:Gulim;font-size:13.3333px">> 4. I guess Apparmor package is deeply dependent on python3. <br><br></span><span style="font-family:Gulim;font-size:13.3333px">The apparmor builds in Ubuntu are dependent on python3 because it seems </span><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">most useful for our users. From the wily buildlogs[1]: </span><br style="font-family:Gulim;font-size:13.3333px"><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">| # Build pythons </span><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">| for py in python2.7 python3.4 python3.5 ; do \ </span><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">| cp -a /«PKGBUILDDIR»/libraries/</span><span style="font-family:Gulim;font-size:13.3333px">libapparmor /«PKGBUILDDIR»/libraries/</span><span style="font-family:Gulim;font-size:13.3333px">libapparmor.$py && \ </span><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">| PYTHON=/usr/bin/$py dh_auto_configure \ </span><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">| -D libraries/libapparmor.$py -- --with-python && \ </span><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">| PYTHON=/usr/bin/$py dh_auto_build \ </span><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">| -D libraries/libapparmor.$py; \ </span><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">| done </span><br style="font-family:Gulim;font-size:13.3333px"><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">When you're building the libraries, try setting the PYTHON environment </span><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">variable to the path of your python interpreter, as done above. (Ignore </span><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">the rest of the dh_auto_* stuff, the important part is the PYTHON </span><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">environment variable before calling configure.) </span><br style="font-family:Gulim;font-size:13.3333px"><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">Thanks </span><br style="font-family:Gulim;font-size:13.3333px"><br style="font-family:Gulim;font-size:13.3333px"><span style="font-family:Gulim;font-size:13.3333px">1: </span><a href="https://launchpadlibrarian.net/216283862/buildlog_ubuntu-wily-amd64.apparmor_2.10-0ubuntu6_BUILDING.txt.gz" target="_blank" style="font-family:Gulim;font-size:13.3333px">https://launchpadlibrarian.net/216283862/buildlog_ubuntu-wily-amd64.apparmor_2.10-0ubuntu6_BUILDING.txt.gz</a><br></div>