TracError: Cannot load Python bindings for PostgreSQL

234 views
Skip to first unread message

Leonard Basuino

unread,
Oct 11, 2012, 10:07:54 PM10/11/12
to trac-users
I have FC14 with two versions of Python installed, one in /usr and another in /usr/local.  The one that works with PostgreSQL in the one in /usr/local.  (I wrote a little python script to test connection to postgres and it works with #!/usr/local/bin/python and fails with #!/usr/bin/python).  I was successful in creating the Trac project connected to the postgres db.

I wound up installing Trac in both paths (should only need it in /usr/local with postgres) and can not get trac to use the one in /usr/local.  I get the subject error when trying to access the url.  From the trace.log:

2012-10-11 18:56:17,580 Trac[env] ERROR: Exception caught while checking for upgrade:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/Trac-1.0-py2.7.egg/trac/env.py", line 837, in open_environment
    needs_upgrade = env.needs_upgrade()
  File "/usr/lib/python2.7/site-packages/Trac-1.0-py2.7.egg/trac/env.py", line 669, in needs_upgrade
    with self.db_query as db:
  File "/usr/lib/python2.7/site-packages/Trac-1.0-py2.7.egg/trac/db/api.py", line 165, in __enter__
    db = DatabaseManager(self.env).get_connection(readonly=True)
  File "/usr/lib/python2.7/site-packages/Trac-1.0-py2.7.egg/trac/db/api.py", line 248, in get_connection
    connector, args = self.get_connector()
  File "/usr/lib/python2.7/site-packages/Trac-1.0-py2.7.egg/trac/db/api.py", line 299, in get_connector
    raise TracError(connector.error)
TracError: Cannot load Python bindings for PostgreSQL

How do I get Trac to use /usr/local/lib instead of /usr/lib?

TIA!
Lenny

Lenny

unread,
Oct 13, 2012, 6:13:57 AM10/13/12
to trac-...@googlegroups.com
After many hours of frustration, I decided to move the conflicting Python files out of the way and get the rest of what I needed installed in /usr (and not /usr/local).  This worked splendidly and now with 1 Python version and no conflict, all is well.

I think the root cause is what's in /etc/profile, which sets the root PATH differently than for all other users.  I.e., root's path does not include /usr/local but all others do.  There still might have been a way to get the Python installed in /usr/lib working, but at this point I am not going to go down that path.

BTW: installing with yum is so much easier than whatever was done to install the conflicting Python version and what was needed to be in it's path.  Don't know why someone decided to install a second Python version, but whatever.

Regards,
Lenny
Reply all
Reply to author
Forward
0 new messages