No module named genshi.builder

198 views
Skip to first unread message

Aikido Guy

unread,
Jun 3, 2016, 7:42:24 PM6/3/16
to Trac Users
Google wasn't letting me continue my other thread... so I've started a new one. Sorry about that.

In short, I'm not able to load Trac 1.0.11 in my browser... I am getting a Trac error about not being able to load genshi.builder.
However, I have confirmed I am able to load the offending line from command line python.

Any idea how to solve this? I've tried stopping apache and then bringing it up again. I've check my trac log for that project but I don't see anything. Maybe I'm missing something obvious?

Any further help is very much appreciated!

Kindly,
Aikido Guy



from command line:

> python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> from pkg_resources import get_distribution
>>> get_distribution('genshi')
Genshi 0.7 (/usr/local/lib/python2.7/dist-packages)
>>> get_distribution('genshi').location
'/usr/local/lib/python2.7/dist-packages'
>>> quit()


and from a browser:

MOD_PYTHON ERROR

ProcessId:      27686
Interpreter:    'main_interpreter'

ServerName:     ... snip ...
DocumentRoot:   '/srv/html'

URI:            '/trac/TracUpgrade_1_0_11'
Location:       '/trac'
Directory:      None
Filename:       '/srv/html/trac'
PathInfo:       '/TracUpgrade_1_0_11'

Phase:          'PythonHandler'
Handler:        'trac.web.modpython_frontend'

Traceback (most recent call last):

  File "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 1202, in _process_target
    module = import_module(module_name, path=path)

  File "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 304, in import_module
    return __import__(module_name, {}, {}, ['*'])

  File "build/bdist.linux-x86_64/egg/trac/web/__init__.py", line 36, in <module>

  File "build/bdist.linux-x86_64/egg/trac/web/api.py", line 31, in <module>

ImportError: No module named genshi.builder

Jun Omae

unread,
Jun 3, 2016, 8:34:22 PM6/3/16
to trac-...@googlegroups.com
On Sat, Jun 4, 2016 at 8:42 AM, Aikido Guy <aiki...@gmail.com> wrote:
> In short, I'm not able to load Trac 1.0.11 in my browser... I am getting a
> Trac error about not being able to load genshi.builder.
> However, I have confirmed I am able to load the offending line from command
> line python.
>
> Any idea how to solve this? I've tried stopping apache and then bringing it
> up again. I've check my trac log for that project but I don't see anything.
> Maybe I'm missing something obvious?

You need to use PythonPath directive.
http://modpython.org/live/current/doc-html/directives.html#pythonpath

--
Jun Omae <jun...@gmail.com> (大前 潤)

RjOllos

unread,
Jun 4, 2016, 11:23:32 PM6/4/16
to Trac Users
Just curious, what did you change (if anything) to go from ImportError of _markerlib, to ImportError of genshi.builder? Did you find a solution to the problem that was causing an ImportError of _markerlib?

- Ryan
 

Aikido Guy

unread,
Jun 5, 2016, 6:07:18 PM6/5/16
to Trac Users
Actually, I did a number of things, including re-installing python2.7 and using the updated pip to upgrade all of my packages. This seems to have gotten me to the ImportError of genshi.builder.
Then, after having a beer and a day's rest (always very helpful!) I came back and the only thing I could think of doing was to change ownership of all files in /usr/local/lib/python2.7/dist-packages/* to www-data:www-data. I reloaded Trac and low and behold, it is now working again!

To be complete, I did not modify the PythonPath directive in mod_python, as I had a python program that was working properly, so I knew that was a red herring. But thank you for the suggestion Jun!

Thank you all! I have been sweating about this all weekend!

With warmest regards... kindly,
Aikido Guy 
Reply all
Reply to author
Forward
0 new messages