Python and mod_wsgi path issue

2

I have an AIX 6.1 system that I've compiled and installed:

  • Apache 2.2.21 (into /usr/local/mercurial)
  • Python 2.7.2 (into /usr/local/bin and /usr/local/lib)
  • mod_wsgi 3.3 (with the AIX fix #1 described here)
  • Mercurial 2.0 (system-wide)

However, when Apache starts, I get the following message in error_log:

IOError: invalid Python installation: unable to open /usr/local/bin/lib/python2.7/config/Makefile (No such file or directory)

See the problem? bin/lib doesn't exist. /usr/local/lib/python2.7/config/Makefile does exist though. However, I can't figure out where it's getting that path from. Here's the environment variables I've got:

PYTHONHOME=/usr/local/bin
PYTHONPATH=/usr/local/lib/python2.7
LIBPATH="/usr/local/mercurial/lib:$LIBPATH"
PATH=/usr/local/bin:/usr/local/lib:$PATH
LDR_CNTRL="MAXDATA=0x80000000"
AIXTHREAD_SCOPE=S
AIXTHREAD_MUTEX_DEBUG=OFF
AIXTHREAD_RWLOCK_DEBUG=OFF
AIXTHREAD_COND_DEBUG=OFF
SPINLOOPTIME=1000
YIELDLOOPTIME=8
MALLOCMULTIHEAP=considersize,heaps:8

I've tried all sorts of combinations with and without PYTHONHOME, PYTHONLIB and PATH in envvars. My PATH, in case it matters is:

/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/opt/ifor/bin:/usr/local/bin:.
apache-2.2
python
mod-wsgi
aix
mercurial
asked on Server Fault Nov 17, 2011 by jasonh • edited Dec 19, 2011 by Martin Geisler

1 Answer

0

PYTHONHOME shouldn't be need. Also, try setting it to /usr/local (the default).

From the documentation:

By default, the libraries are searched in prefix/lib/pythonversion and exec_prefix/lib/pythonversion, where prefix and exec_prefix are installation-dependent directories, both defaulting to /usr/local.

When PYTHONHOME is set to a single directory, its value replaces both prefix and exec_prefix.

answered on Server Fault Jan 29, 2014 by hdiogenes

User contributions licensed under CC BY-SA 3.0