Modify

Opened 6 years ago

Closed 6 years ago

#2815 closed defect (fixed)

Cannot upgrade after install leads to ImportError: No module named path error

Reported by: seeker136@… Owned by: coling
Priority: normal Component: WorkLogPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I installed worklog from svn (0.11) using easy_install script. Everything seemed to work ok, but after enabling the plugin in trac.ini and performing upgrade using trac-admin I get the following message:

Database is up to date, no upgrade necessary.

If I ignore the message, restart my web server and navigate to my project, I get the following message:

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/web/api.py", line 339, in send_error
    'text/html')
  File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/web/chrome.py", line 672, in render_template
    template = self.load_template(filename, method=method)
  File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/web/chrome.py", line 648, in load_template
    self.templates = TemplateLoader(self.get_all_templates_dirs(),
  File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/web/chrome.py", line 402, in get_all_templates_dirs
    dirs += provider.get_templates_dirs()
  File "build/bdist.linux-i686/egg/worklog/webui.py", line 170, in get_templates_dirs
  File "/usr/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg/pkg_resources.py", line 16, in ?
    import sys, os, zipimport, time, re, imp, new
  File "/usr/lib/python2.4/os.py", line 133, in ?
    from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep,
ImportError: No module named path

Here are the relevant details for my setup:

  • Ubuntu Linux 6.06
  • Trac 0.11b2
  • Python 2.4
  • Apache 2.0.55
  • mod_python
  • MySql 5.0.22

Attachments (1)

trac.log (9.7 KB) - added by akaihola 6 years ago.
log output (level DEBUG) when this error occurs

Download all attachments as: .zip

Change History (14)

comment:1 Changed 6 years ago by coling

That bit of the file is pretty standard. I just copied it from other plugins, so I'm guessing either b2 has broken the plugin/template API or there is something wrong with your setup tools.

I'm running with Trac trac:r6097 with no problems.

I've been meaning to bring everything up-to-date tho', so I'll try and see if I can reproduce sometime soon. In the mean time let me know if you solve it.

comment:2 Changed 6 years ago by coling

  • Status changed from new to assigned

comment:3 Changed 6 years ago by anonymous

Hi,

I went from a ubuntu 6.6 to 6.10 and encouter the same problem now. The problem might be related to this bug in ubuntu updgrade as this error was encoutered during the upgrade: https://bugs.launchpad.net/ubuntu/+source/clearsilver/+bug/68764

comment:4 Changed 6 years ago by coling

(In [3483]) Update the Admin pages to the new Trac API. Not really tested this but at least the plugin loads now. Will do more testing shortly.
Fixes #2834, Refs #2815 - Can the reporters please check the status of #2815 and close if appropriate. It's not quite the same error as #2834 but it looks as if it could be related.
Thanks.

comment:5 Changed 6 years ago by akaihola

I'm hit by the same problem.

When I upgraded Trac from 0.11b1 to 0.11b2, I lost the work log admin settings page (just showed the worklog page), and Stop work didn't ask for a message anymore.

I then upgraded worklog to current 0.11 trunk (revision 3565) and got the error reported above.

comment:6 Changed 6 years ago by akaihola

Oh, and I have a stock Debian 4.0 Etch setup with Python 2.4, running tracd stand-alone.

comment:7 Changed 6 years ago by coling

Can you enable logging please and give me a full trace (including the reasons why the plugin could not be loaded (e.g. from the beginning of a restart). Thanks.

Changed 6 years ago by akaihola

log output (level DEBUG) when this error occurs

comment:8 Changed 6 years ago by akaihola

The attachmend above contains all log output from a tracd restart up to the error described above.

Note that even though I have other plugins as seen in the log, I disabled them for this particular trac project.

comment:9 Changed 6 years ago by akaihola

I checked out the worklog 0.11 source and tried importing it in the Python interpreter:

Python 2.4.4 (#2, Apr  5 2007, 20:11:18) 
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import worklog
/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/__init__.py:14: UserWarning: Module worklog was already imported from worklog/__init__.py, but /usr/lib/python2.4/site-packages/worklog-0.1-py2.4.egg is being added to sys.path
  __version__ = __import__('pkg_resources').get_distribution('Trac').version
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "worklog/__init__.py", line 1, in ?
    from api import *
  File "worklog/api.py", line 10, in ?
    from webadminui import *
  File "worklog/webadminui.py", line 8, in ?
    from trac.ticket.admin import TicketAdminPanel
ImportError: cannot import name TicketAdminPanel

comment:10 Changed 6 years ago by akaihola

Might have something to do with this? (0.11b2 was revision 6685)

I'll try with Trac current trunk.

comment:11 Changed 6 years ago by coling

OK, this is the key failure:

2008-04-28 13:17:01,931 Trac[__init__] ERROR: Skipping "worklog = worklog": (can't import "cannot import name TicketAdminPanel")

Which is generated from:

from trac.ticket.admin import TicketAdminPanel

in webadminui.py.

I can't say why this is happening.

In Trac trunk it has the following definition:

trac/ticket/admin.py:class TicketAdminPanel(Component):

So I can't think why you cannot access it unless your trunk is out of date (does b2 have this change? I think it should... perhaps you have some weird egg cache thing going on?) :s

comment:12 Changed 6 years ago by akaihola

Updated Trac to trunk, now works correctly. Apparently the TicketAdminPage to TickeAdminPanel rename has occurred after 0.11b2.

But still no Work Log admin page. If I go to /admin/ticket/worklog, I get exactly the same page as from /worklog (the work log summary).

comment:13 Changed 6 years ago by coling

  • Resolution set to fixed
  • Status changed from assigned to closed

Sorry for the delays, but I've eventually fixed the final problem with [5022]. Better late than never ;)

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from coling. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.