Opened 17 years ago

Closed 16 years ago

Last modified 15 years ago

#12034 closed defect (fixed)

Trac python25 dependency breaks mod_python installations

Reported by: macports@… Owned by: danielluke (Daniel J. Luke)
Priority: Normal Milestone:
Component: ports Version: 1.4.42
Keywords: trac Cc:
Port:

Description

[Firstly I admit installing Trac via MacPorts/Darwinports has always been a bit of an arms race so I really appreciate the time contributed]

I recently upgraded from Trac 0.10.4 to 0.10.4_1 (I think, or at least a *very* minor point release) and suddenly Trac is dependent on python25 rather than python24 (r25504 and r25506).

There is no indication on the Trac website that python25 is required (certainly not before 0.11) and there is no real explanation, but looking at the commits the dependencies appear more to do with MySQL and Postgres variants.

Possibly this may be something to do with python25-sqlite3 - but I have the same Trac versions running on Ubuntu and Debian linux without python25, and there certainly seem to be more issues with python25 and Trac still to be addressed.

Specifically this change makes it impossible to use mod_python with Trac as there is no python25 macport for it, and the python25 port does not appear complete so additional problems can be expected with Trac plug-ins, etc.

Change History (6)

comment:1 Changed 17 years ago by macports@…

Instructions followed for mod_python setup.

My relevant ports:

  trac @0.10.4_1 (active)
  apache2 @2.2.4_0 (active)
  clearsilver @0.10.4_1 (active)
  neon @0.26.3_0 (active)
  sqlite3 @3.3.17_0+darwin_8 (active)
  subversion @1.4.3_1 (active)
  subversion-pythonbindings @1.4.3_1 (active)
  swig @1.3.31_0+darwin_8 (active)
  mod_python @3.3.1_0 (active)
  py-bsddb @2.4.4_0 (active)
  py-setuptools @0.6c5_0 (active)
  py-sqlite @2.3.3_0 (active)
  py25-bsddb @2.5.1_0 (active)
  py25-hashlib @2.5.1_0 (active)
  py25-sqlite3 @2.5.1_0 (active)
  python24 @2.4.4_1+darwin_8 (active)
  python25 @2.5.1_1+darwin_8 (active)

My Apache2 conf for mod_python:

  <Location "/code">
    SetHandler mod_python
    PythonDebug on
    # neither below makes a difference
    #PythonInterpreter main_interpreter
    #PythonPath "sys.path+['/opt/local/bin/python25']"
    PythonHandler trac.web.modpython_frontend 
    PythonOption TracEnvParentDir "/Users/scribble/UNIX/share/trac"
    PythonOption TracUriRoot "/code"
    PythonOption TracLocale "en_GB.UTF-8"
    SetEnv PYTHON_EGG_CACHE "/tmp/eggs"

    # allow access
    Order allow,deny
    Allow from all
  </Location>

My specific error:

MOD_PYTHON ERROR

Traceback (most recent call last):

  File "/opt/local/lib/python2.4/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/opt/local/lib/python2.4/site-packages/mod_python/importer.py", line 1202, in _process_target
    module = import_module(module_name, path=path)

  File "/opt/local/lib/python2.4/site-packages/mod_python/importer.py", line 304, in import_module
    return __import__(module_name, {}, {}, ['*'])

ImportError: No module named trac.web.modpython_frontend

Some output from the Terminal:

[scribble]: ls -l /opt/local/bin/py*
lrwxr-xr-x   1 root  admin       69 May 28 18:43 /opt/local/bin/pydoc -> /opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin/pydoc
lrwxr-xr-x   1 root  admin       72 May 28 18:43 /opt/local/bin/pydoc2.4 -> /opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin/pydoc2.4
-rwxr-xr-x   2 root  admin       81 May 26 09:09 /opt/local/bin/pydoc2.5
lrwxr-xr-x   1 root  admin       69 May 28 18:43 /opt/local/bin/pydoc24 -> /opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin/pydoc
lrwxr-xr-x   1 root  admin       70 May 28 18:43 /opt/local/bin/python -> /opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin/python
lrwxr-xr-x   1 root  admin       16 May 28 18:23 /opt/local/bin/python-config2.5 -> python2.5-config
lrwxr-xr-x   1 root  admin       73 May 28 18:43 /opt/local/bin/python2.4 -> /opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin/python2.4
-rwxr-xr-x   2 root  admin  3975768 May 26 09:09 /opt/local/bin/python2.5
-rwxr-xr-x   2 root  admin     1424 May 26 09:09 /opt/local/bin/python2.5-config
lrwxr-xr-x   1 root  admin       71 May 28 18:43 /opt/local/bin/pythonw -> /opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin/pythonw
lrwxr-xr-x   1 root  admin       74 May 28 18:43 /opt/local/bin/pythonw2.4 -> /opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin/pythonw2.4

[scribble]: which python
/opt/local/bin/python
[scribble]: python
Python 2.4.4 (#1, May 21 2007, 11:55:35) 
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import trac
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named trac
>>> 
Ctrl+D

[scribble]: /opt/local/bin/python2.5   
Python 2.5.1 (r251:54863, May 26 2007, 09:07:18) 
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import trac
>>> 

comment:2 Changed 17 years ago by macports@…

My current workaround has been to download and compile mod_python myself (v3.3.1).

To compile against python25 installed by MacPorts you *must* create a symlink from:

 ln -s /opt/local/bin/python2.5 /opt/local/bin/python

moving the python2.4 link if present (this is why I think the python25 port is incomplete), and add the path to the MacPorts Apache2 install when configuring (it should warn about the builtin OS X Apache 1.3 not being supported):

 ./configure --with-apxs=/opt/local/apache2/bin
 make
 make install

The symlink can be removed/reset afterward.

comment:3 Changed 17 years ago by dr2chase@…

You meant to say (in the workaround):

./configure --with-apxs=/opt/local/apache2/bin/apxs
make
sudo make install

which is what worked for me. The configure fails if the apxs binary is not explicitly named.

comment:4 Changed 17 years ago by Emil.Lundberg@…

Thanks for the info. As an alternative, use port edit mod_python to change the references to python24 / 2.4 to python24 / 2.5, then do port install mod_python. This builds cleanly, although it does complain about the ports-filesystem being violated (I assume this is because mod_python.so is copied into the /opt/local/apache2/modules).

I too greatly appreciate the possibility of installing Trac through MacPorts. Forking the mod_python port or creating a python25 variant would make it even easier (actually, this was the only glitch using MacPorts 1.5)... ;-)

comment:5 Changed 16 years ago by danielluke (Daniel J. Luke)

Resolution: fixed
Status: newclosed

There is a mod_python25 port now (or you can avoid that hassle by using fastcgi instead ;-) ).

comment:6 Changed 15 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.