{"id":133,"date":"2017-01-29T13:32:36","date_gmt":"2017-01-29T13:32:36","guid":{"rendered":"https:\/\/thinkdebian.net\/blog\/?p=133"},"modified":"2017-11-26T18:05:41","modified_gmt":"2017-11-26T18:05:41","slug":"apache2-mod_python-version-mismatch","status":"publish","type":"post","link":"https:\/\/thinkdebian.net\/blog\/apache2-mod_python-version-mismatch\/","title":{"rendered":"apache2 mod_python version mismatch"},"content":{"rendered":"<p>I was getting some warnings in one machine&#8217;s Apache 2 web server error log regarding mod_python, see below:<\/p>\n<pre>[Wed Jan 25 01:29:11.717727 2017] [:error] [pid 4389] python_init: Python version mismatch, expected '2.7.5+', found '2.7.9'.\r\n[Wed Jan 25 01:29:11.717856 2017] [:error] [pid 4389] python_init: Python executable found '\/usr\/bin\/python'.\r\n[Wed Jan 25 01:29:11.717864 2017] [:error] [pid 4389] python_init: Python path being used '\/usr\/lib\/python2.7\/:\/usr\/lib\/python2.7\/plat-x86_64-linux-gnu:\/usr\/lib\/python2.7\/lib-tk:\/usr\/lib\/python2.7\/lib-old:\/usr\/lib\/python2.7\/lib-dynload'.\r\n<\/pre>\n<p>The issue is with libapache2-mod-python. The Python version installed in the system is newer than the one mod_python was built for. \u00a0Of course, 2.7.9 is newer than 2.7.5+, as required, so the module works, and the error part should be a warning, not an error. \u00a0A bug has been reported for this issue for Ubuntu in Launchpad (bug <a href=\"https:\/\/bugs.launchpad.net\/ubuntu\/+source\/libapache2-mod-python\/+bug\/1073147\">1073147<\/a>), but applies to Debian as well.<\/p>\n<p>Two\u00a0comments in that thread are key if you are facing this issue, comments <a href=\"https:\/\/bugs.launchpad.net\/ubuntu\/+source\/libapache2-mod-python\/+bug\/1073147\/comments\/1\">#1<\/a> and <a href=\"https:\/\/bugs.launchpad.net\/ubuntu\/+source\/libapache2-mod-python\/+bug\/1073147\/comments\/8\">#8<\/a>. \u00a0I am also pasting those here as well for posterity (and to quickly remind myself what I did to fix the issue):<\/p>\n<p>#1\u00a0<a id=\"yui_3_10_3_1_1485340794480_359\" class=\"sprite person\" href=\"https:\/\/launchpad.net\/~doko\">Matthias Klose (doko)<\/a><\/p>\n<pre>known issue, however it's a warning, the module continues to work.\r\n<\/pre>\n<p>#8\u00a0<a class=\"sprite person\" href=\"https:\/\/launchpad.net\/~0-robert\">Robert Hernandez (0-robert)<\/a><\/p>\n<pre># You have to recompile mod-python and\/or mod-wsgi.<\/pre>\n<pre lang=\"bash\">\r\n# Remove mods\r\napt-get remove libapache2-mod-python libapache2-mod-wsgi\r\n\r\n# Get dependencies\r\napt-get build-dep libapache2-mod-python libapache2-mod-wsgi\r\n\r\n# Build mod-python\r\nmkdir \/tmp\/python\r\ncd \/tmp\/python\r\napt-get source libapache2-mod-python\r\ncd libapache2-mod-python-[x.x.x]\r\ndpkg-buildpackage -rfakeroot -b\r\n\r\n#Build mod-wsgi\r\nmkdir \/tmp\/wsgi\r\ncd \/tmp\/wsgi\r\napt-get source libapache2-mod-wsgi\r\ncd mod-wsgi-[x.x.x]\r\ndpkg-buildpackage -rfakeroot -b\r\n\r\n# Install newly compiled packages\r\ndpkg -i \/tmp\/python\/libapache2-mod-python-[x.x].deb \/tmp\/wsgi\/libapache2-mod-wsgi-[x.x].deb\r\n<\/pre>\n<p>Credit goes to all who commented in that thread and helped solve this issue.<\/p>\n<p>The solution proposed worked for me on Debian Wheezy 7.11 amd64 on\u00a02017.01.25 &amp;\u00a0Debian Jessie 8.7 amd64 on 2017.01.25.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was getting some warnings in one machine&#8217;s Apache 2 web server error log regarding mod_python, see below: [Wed Jan 25 01:29:11.717727 2017] [:error] [pid 4389] python_init: Python version mismatch, expected &#8216;2.7.5+&#8217;, found &#8216;2.7.9&#8217;. [Wed Jan 25 01:29:11.717856 2017] [:error] [pid 4389] python_init: Python executable found &#8216;\/usr\/bin\/python&#8217;. [Wed Jan 25 01:29:11.717864 2017] [:error] [pid 4389] &#8230; <a title=\"apache2 mod_python version mismatch\" class=\"read-more\" href=\"https:\/\/thinkdebian.net\/blog\/apache2-mod_python-version-mismatch\/\" aria-label=\"More on apache2 mod_python version mismatch\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,4,8],"tags":[9,32,12,13,31,30],"_links":{"self":[{"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/posts\/133"}],"collection":[{"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/comments?post=133"}],"version-history":[{"count":14,"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/posts\/133\/revisions"}],"predecessor-version":[{"id":209,"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/posts\/133\/revisions\/209"}],"wp:attachment":[{"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/media?parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/categories?post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/tags?post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}