[mod_python] how to configure sys.path when installing not into python's lib directory?

Graham Dumpleton graham.dumpleton at gmail.com
Mon Jul 27 23:39:56 EDT 2009


Bounced back to mod_python list. I will replay later. Please use
reply-all in future to keep it on the list. In the mean time look at
mod_wsgi and WSGI capable Python web frameworks such as Django,
Pylons, Werkzeug and TurboGears. There are many others though.

Graham

2009/7/28 Marc Weber <marco-oweber at gmx.de>:
> Hi Graham,
>
> mod_python looks in:
>  '$PYTHON_INSALL_LOCATION/lib/python25.zip'
>  '$PYTHON_INSALL_LOCATION/lib/python2.5'
>  '$PYTHON_INSALL_LOCATION/lib/python2.5/plat-linux2'
>  '$PYTHON_INSALL_LOCATION/lib/python2.5/lib-tk'
>  '$PYTHON_INSALL_LOCATION/lib/python2.5/lib-dynload'
>  '$PYTHON_INSALL_LOCATION/lib/python2.5/site-packages'
> It only contains default paths of the python installation.
>
> mod_python has been installed to:
>
>  $PACKAGE_DIR/nix/store/axq79wn5py4sfi2n142jfc4arvgyr957-python-2.5.4/lib/python2.5/site-packages/mod_python/*
>  $PACKAGE_DIR/modules/mod_python.so
>
> PACKAGE_DIR            = /nix/store/ax9qlhyfjlsnc9lxa3p80gy1qsrjpn2m-apache-httpd-mod-python-3.3.1
> PYTHON_INSALL_LOCATION = /nix/store/axq79wn5py4sfi2n142jfc4arvgyr957-python-2.5.4
>
> both are different. Goto www.nixos.org to read up more details about
> this packaging scheme if you're interested.
>
>> /nix/store/axq79wn5py4sfi2n142jfc4arvgyr957-python-2.5.4/lib/python2.5/site-packages
>> unless the Python installation has been mightily fiddled with as well.
> Yes, I did so to make it install into its own directory. After python
> has been build no other build process is allowed to write into
> $PYTHON_INSALL_LOCATION for purity reasons.
>
>> You can't use SetEnv to control environment variables that Python
>> might be able to use at initialisation time.
> So can I do PYTHONPATH=foo $RUN_APACHE instead? I'll try.
>
>> If all you want to do is host a WSGI capable Python application,
> Basically I'd like to replace some PHP development by Python because I
> like some Python libraries such as SQLAlchemy. And mod_python was the
> first solution I found when searching for Apache and Python. I know
> there is also zope.. But I think deploying some .py files might be
> faster than setting up another server and http proxies.
>
> I'll look into WSGI! Thank you!
>
>> it where Python installation is, but then that shouldn't be required
>> unless the Python installation has been totally stuffed up with this
>> packaging scheme.
> Python doesn't fit very well into this packaging scheme for various
> reasons. On gtk, gnome packages I gave up and made one package
> installing them all into one package location which is still different
> from PYTHON_INSALL_LOCATION.
> That's why I don't know yet how many packages should be
> packaged in this way at all. Eg setup-tools and eggs seems to be a
> mature different distribution system. So maybe I'm not going to package
> much more than the very basic packages this way.
>
>> > Can I automatically patch the .c code to add that module directory?
>> Sounds like the wrong way of going about it.
> If it solves the problem why not?
>
> Thank you for your reply!
>
> Marc Weber
>



More information about the Mod_python mailing list