Apologies for the more gentile readers for this niche technical post, but I’m hoping to solve my technical brothers and sisters some frustrations with Trac, the excellent open source issue tracking system (we’ve been using it for more than 2 years to manage our work with Yankee Publishing, and it’s been truly transformational).
If you’re upgrading from Trac 0.11 to Trac 0.12 and you’re using Trac with Apache and mod_python you might find that after you upgrade you either get a “500 Internal Server Error” form Apache when you visit Trac or, if you have mod_python debugging on (or if you look in your Apache error log), an error message ImportError: No module named trac.
And yet you think that Trac actually is there: you can use trac-admin from the command line, and if you look where you think Trac should be (say, perhaps, in /usr/lib/python2.4/site-packages), you find that it is indeed there.
What’s going on?
It seems that Trac 0.12, at least when I installed it, installs itself as a “zipped egg.” I realized this was true when, after I did:
easy_install Trac-0.12b1.zip
I ended up with a file (not a directory) in /usr/lib/python2.4/site-packages. My earlier versions of Trac were directories, not files. This, and this helpful post that says, in part:
mod_python 3.x is still unable to import modules from .zipped .egg-files. Command-line python (even older version 2.4 which is included into RHEL5/CentOS5) imports modules from zipped eggs without any problem, but not mod_python for the same version because it overrides the standard importer in its own special way.
So, in other words, Trac is there, it’s just that mod_python can’t see it because it’s zipped. Once I knew this, the solution was easy:
easy_install --always-unzip Trac-0.12b1.zip
Installing this way ensures that the resulting egg isn’t zipped, and once I did this Trac 0.12 ran without issue.
Comments
I predict this will post will
I predict this will post will generate some very high traffic numbers over time.
Thanks !!! it really helped
Thanks !!! it really helped me.
I just unzipped the egg and it solved the problem !
THANK YOU!!!!!! After 2 and a
THANK YOU!!!!!! After 2 and a half hours of dicking around with python and YUM being retarded I had this happen and this is the ONLY website that is even remotely on an understandable level or is even in a readable layout. Took me 30 seconds after reading this. Apparently Trac dev’s screwed up hard if they forgot to make sure the egg is unzipped.
Posted some links to this
Posted some links to this page on trac website, in tickets concerning this problem.
Oh, and it helped me too, thanks.
I installed the mastertickets
I installed the mastertickets plugin, and foolishly ran the included ‘setup.py’, and was wondering why it decided to update my trac installation to 0.12 without me asking it to. That dreaded 500 Internal Server Error appeared, and this post here is the ONLY place i found the solutino for this. Thanks a bunch!
M.
Thank you so much for posting
Thank you so much for posting this. To reiterate what an earlier commenter has said, it seems like you’re the only person on the web who has solved this problem, and it was such a quick solution.
Thank You!You saved my life.
Thank You!
You saved my life. I was fighting with Trac for the last 3 days. It is finally working.
Thank You!
Traffic numbers are low, but,
Traffic numbers are low, but, as you can see from comments that follow, the post has been of some surgical help to those in need. Which was my reason for writing.
OH MY GOD! Thank you!This
OH MY GOD! Thank you!
This error was driving me insane!
Thank you very much~
Thank you very much~
mate - Thanks very much!
mate - Thanks very much!
This was helpful, but it didn
This was helpful, but it didn’t work until I removed the Trac-0.12.1.py2.4.egg from /usr/lib/python2.4/site-packages then ran the easy_install —always-unzip —upgrade Trac==0.12.1 again.
Yep Many Many thx!Don't
Yep Many Many thx!
Don't forget to restart apache! (was needed in my case)
CentOS:
service httpd restart
Thank you! A thousand times,
Thank you! A thousand times, thank you! I cannot believe this actually worked, but it did =D
Note: I had already installed the .egg’s the normal way, deleting them and then reinstalling them (with easy_install) did the trick.
THANK YOU FOR LEAVING THIS
THANK YOU FOR LEAVING THIS MESSAGE FOR POSTERITY!!!
I had a similar problem and
I had a similar problem and after i tried everything i found that the problem was in the permissions of the /usr/lib/python2.4/site-packages directory (i installed trac as root), i changed the owner of the directory and all subdirectories and files and it worked like a charm, maybe this could help anyone with this similar problem.
This just saved me an evening
This just saved me an evening... many thanks!
It's the end of the year 2016
It's the end of the year 2016, and this post just saved my SVN migration from a very old Ubuntu to RHEL 7. Thank you.
Add new comment