You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by "Graham Dumpleton (JIRA)" <ji...@apache.org> on 2008/09/29 01:38:44 UTC

[jira] Commented: (MODPYTHON-252) mod_python install forces Python libraries into system-wide install directory

    [ https://issues.apache.org/jira/browse/MODPYTHON-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635266#action_12635266 ] 

Graham Dumpleton commented on MODPYTHON-252:
--------------------------------------------

You shouldn't need to use --with-apache option, only use --with-apxs.

If wanting to install Python stuff into a different location you have a couple of options.

1. When doing installation, use:

  make install_dso
  DESTDIR=/home/user/libraries/ make install_py_lib

If you do this though, Python when used in mod_python will not know where to find the files as not on standard Python module search path. Thus you would have to organise for PYTHONPATH to be set in environment of Apache when run to reference the alternate location.

2. Use a Python virtual environment instead. Ie., virtualenv. See:

  http://pypi.python.org/pypi/virtualenv

Build mod_python against that using --with-python option after having activated the environment.

If you do this though, because 'python' executable not in standard locations, you will need to set PATH in environment of Apache when run to reference that virtual environment's bin directory, or set PYTHONHOME in environment to location of virtual environment.




> mod_python install forces Python libraries into system-wide install directory
> -----------------------------------------------------------------------------
>
>                 Key: MODPYTHON-252
>                 URL: https://issues.apache.org/jira/browse/MODPYTHON-252
>             Project: mod_python
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.3.1
>         Environment: Tested on Linux, with mod_python 3.3.1
>            Reporter: Josh Kupershmidt
>            Priority: Minor
>             Fix For: 3.3.1
>
>
> I need to have mod_python installed as an unprivileged user. I have Apache installed as an unprivileged user, to directory
> /home/user/apache/2.0.63/... 
> And I need mod_python.so installed to 
> /home/user/apache/2.0.63/modules
> The arguments I pass to ./configure are:
> ./configure --with-apache=/home/user/apache/2.0.63/ --prefix=/home/user/apache/2.0.63/modules/ --with-python=/directory/to/system-wide/install/of/python --with-apxs=/home/user/apache/2.0.63/bin
> This all works fine for installing mod_python.so into Apache's modules directory. However, the Python libraries are being forced into /directory/to/system-wide/install/of/python/lib/python2.5/site-packages. I really want these Python libraries installed into /home/user/libraries/
> I've tracked the problem, and my somewhat kludgy workaround, down to ./dist/Makefile.in. The following lines in ./dist/Makefile.in note that root privileges may be required:
> # this may require root priviledges
> install_py_lib: mod_python src
>         @cd src; $(MAKE) psp_parser.c
>         if test -z "$(DESTDIR)" ; then \
>                 export LDFLAGS="-L$(PYTHON_LIBDIR)" ; $(PYTHON_BIN) setup.py install  --optimize 2 --force ; \
>         else \
>                 export LDFLAGS="-L$(PYTHON_LIBDIR)" ; $(PYTHON_BIN) setup.py install --optimize 2 --force --root $(DESTDIR) ; \
> To get around the requirement for installing the Python libraries system-wide, I simply added --prefix=/home/user/libraries/  after "setup.py install" in the above lines as a workaround. 
> Note that the $DESTDIR variable in the above lines does not do what I want: I tried manually setting DESTDIR, but it forced the entire mod_python install (of mod_python.so, as well as the Python libraries) into subdirectories of /home/user/libraries. It also screwed up any other installs (e.g. httpd) done at the same time which also depend on the DESTDIR environment variable, if exported globally. 
> I recommend a ./configure flag be added to allow the user to specify which directory the mod_python Python libraries should be installed into, and perhaps a note about setting PYTHONPATH appropriately. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.