{"id":6800,"date":"2014-04-23T08:06:59","date_gmt":"2014-04-23T08:06:59","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/23\/apache-showing-python-version-mismatch-with-mod_wsgi-collection-of-common-programming-errors\/"},"modified":"2014-04-23T08:06:59","modified_gmt":"2014-04-23T08:06:59","slug":"apache-showing-python-version-mismatch-with-mod_wsgi-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/23\/apache-showing-python-version-mismatch-with-mod_wsgi-collection-of-common-programming-errors\/","title":{"rendered":"Apache showing &ldquo;Python version mismatch&rdquo; with mod_wsgi-Collection of common programming errors"},"content":{"rendered":"<p>I am trying to get web.py working.<\/p>\n<p>I have compiled mod_wsgi to use python2.6, and configured my virtualhost correctly (at least I am pretty sure it is!). The hello, world application keeps showing up as 404. I changed the loglevel of Apache to info. and am seeing the following:<\/p>\n<pre><code>[Wed Sep 28 15:41:12 2011] [info] mod_wsgi (pid=25969): Attach interpreter ''.\n[Wed Sep 28 15:42:55 2011] [info] mod_wsgi (pid=25969): Create interpreter 'clearpoint.turnleftllc.com|\/budgetcalculator'.\n[Wed Sep 28 15:45:33 2011] [info] mod_wsgi (pid=25969): Destroying interpreters.\n[Wed Sep 28 15:45:33 2011] [info] mod_wsgi (pid=25969): Destroy interpreter 'clearpoint.turnleftllc.com|\/budgetcalculator'.\n[Wed Sep 28 15:45:33 2011] [info] mod_wsgi (pid=25969): Cleanup interpreter ''.\n[Wed Sep 28 15:45:33 2011] [info] mod_wsgi (pid=25969): Terminating Python.\n[Wed Sep 28 15:45:33 2011] [error] Exception KeyError: KeyError(-1216178416,) in  ignored\n[Wed Sep 28 15:45:33 2011] [info] mod_wsgi (pid=25969): Python has shutdown.\nFatal Python error: Interpreter not initialized (version mismatch?)\n<\/code><\/pre>\n<p>Regarding the KeyError, I am really not sure where that is coming from. I tested the application from the command line (python26 code.py) and it executes without error. It gives no output whatsoever in fact.<\/p>\n<p>Just in case, here is my VirtualHost configuration, as well as the application code:<\/p>\n<p>Python Code (taken directly from the web.py site):<\/p>\n<pre><code>#!\/usr\/bin\/python26\nimport web\n\nurls = (\n        '\/.*', 'index'\n        )\n\nclass index:\n    def GET(self):\n        return \"Hello, world!\"\n\n\napp = web.application(urls,globals()).wsgifunc()\n<\/code><\/pre>\n<p>VirtualHost:<\/p>\n<pre><code>\n        ServerAdmin \"tom@turnleftllc.com\"\n        ServerName clearpoint.turnleftllc.com\n        ServerAlias clearpoint\n        ErrorLog logs\/clearpoint_error_log\n\n        DocumentRoot \/home\/turnleftllc\/public_html\/cpccs\n        WSGIScriptAlias \/budgetCalculator \/home\/turnleftllc\/public_html\/cpccs\/apps\/code.py\n        Alias \/budgetCalculator\/static \/home\/turnleftllc\/public_html\/cpccs\/apps\/static\n        AddType text\/html .py\n        \n                Order allow,deny\n                Allow from all\n                AllowOverride All\n        \n        \n                Order allow,deny\n                Allow from all\n        \n\n<\/code><\/pre>\n<p>I am using CentOS5, which defaults to python2.4. I did uninstall and recompile mod_wsgi for python2.6 (as you can see in the output, it&#8217;s definitely initializing 2.6).<\/p>\n<p>Any help would be greatly appreciated!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am trying to get web.py working. I have compiled mod_wsgi to use python2.6, and configured my virtualhost correctly (at least I am pretty sure it is!). The hello, world application keeps showing up as 404. I changed the loglevel of Apache to info. and am seeing the following: [Wed Sep 28 15:41:12 2011] [info] [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6800","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6800"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6800\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}