Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Trac: Users

TracError: Cannot load Python bindings for PostgreSQL

 

 

Trac users RSS feed   Index | Next | Previous | View Threaded


david.genest at gmail

May 23, 2012, 6:41 PM

Post #1 of 3 (373 views)
Permalink
TracError: Cannot load Python bindings for PostgreSQL

Hi,

Not sure what changed in my hosting environment, but when I upgraded an
extension (mercurial plugin that was failing), trac ceased to work saying
it cannot load Python bindings for PostgreSQL. But everything was workihg
before.

I have psycopg2 installed. Trac was working.

Tried upgrading to latest trac. Still broken.

Note that I can load psycopg2 from a python prompt. I can also run without
errors when I create an environment manually in a python shell.

The log posted below mentions exception while checking for upgrade. Is it
possible to disable the upgrade checking to see if it's related to that?
There is also an AttributeError in AdminModule.

Can anybody help ? Thanks.

David.

Here is the relevant part of my log:

2012-05-23 20:11:24,790 Trac[env] ERROR: Exception caught while checking
for upgrade:
Traceback (most recent call last):
File "/home/iekho/lib/python2.7/trac/env.py", line 667, in
open_environment
needs_upgrade = env.needs_upgrade()
File "/home/iekho/lib/python2.7/trac/env.py", line 497, in needs_upgrade
db = self.get_db_cnx()
File "/home/iekho/lib/python2.7/trac/env.py", line 329, in get_db_cnx
return get_read_db(self)
File "/home/iekho/lib/python2.7/trac/db/api.py", line 90, in get_read_db
return _transaction_local.db or DatabaseManager(env).get_connection()
File "/home/iekho/lib/python2.7/trac/db/api.py", line 150, in
get_connection
connector, args = self.get_connector()
File "/home/iekho/lib/python2.7/trac/db/api.py", line 195, in
get_connector
raise TracError(connector.error)
TracError: Cannot load Python bindings for PostgreSQL
2012-05-23 20:11:24,790 Trac[env] WARNING: base_url option not set in
configuration, generated links may be incorrect
2012-05-23 20:11:24,790 Trac[main] DEBUG: Dispatching <Request "GET '/'">
2012-05-23 20:11:24,804 Trac[chrome] DEBUG: Prepare chrome data for request
2012-05-23 20:11:24,808 Trac[session] DEBUG: Retrieving session for ID
'david'
2012-05-23 20:11:24,809 Trac[main] ERROR: can't retrieve session:
TracError: Cannot load Python bindings for PostgreSQL
2012-05-23 20:11:24,810 Trac[chrome] ERROR: Error with navigation
contributor AdminModule: AttributeError: 'FakePerm' object has no attribute
'has_permission'
2012-05-23 20:11:24,811 Trac[api] INFO: Synchronized '(default)' repository
in 0.01 seconds
2012-05-23 20:11:24,812 Trac[main] WARNING: HTTPInternalError: 500 Trac
Error (Cannot load Python bindings for PostgreSQL)

Thanks.

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/C7FI_qLvsoYJ.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.


david.genest at gmail

May 24, 2012, 3:25 AM

Post #2 of 3 (354 views)
Permalink
Re: TracError: Cannot load Python bindings for PostgreSQL [In reply to]

Ok, I found a fix for my problem. I removed my setuptools.pth file on my
host (webfaction)

On Wednesday, 23 May 2012 21:41:56 UTC-4, David Genest wrote:
>
> Hi,
>
> Not sure what changed in my hosting environment, but when I upgraded an
> extension (mercurial plugin that was failing), trac ceased to work saying
> it cannot load Python bindings for PostgreSQL. But everything was workihg
> before.
>
> I have psycopg2 installed. Trac was working.
>
> Tried upgrading to latest trac. Still broken.
>
> Note that I can load psycopg2 from a python prompt. I can also run without
> errors when I create an environment manually in a python shell.
>
> The log posted below mentions exception while checking for upgrade. Is it
> possible to disable the upgrade checking to see if it's related to that?
> There is also an AttributeError in AdminModule.
>
> Can anybody help ? Thanks.
>
> David.
>
> Here is the relevant part of my log:
>
> 2012-05-23 20:11:24,790 Trac[env] ERROR: Exception caught while checking
> for upgrade:
> Traceback (most recent call last):
> File "/home/iekho/lib/python2.7/trac/env.py", line 667, in
> open_environment
> needs_upgrade = env.needs_upgrade()
> File "/home/iekho/lib/python2.7/trac/env.py", line 497, in needs_upgrade
> db = self.get_db_cnx()
> File "/home/iekho/lib/python2.7/trac/env.py", line 329, in get_db_cnx
> return get_read_db(self)
> File "/home/iekho/lib/python2.7/trac/db/api.py", line 90, in get_read_db
> return _transaction_local.db or DatabaseManager(env).get_connection()
> File "/home/iekho/lib/python2.7/trac/db/api.py", line 150, in
> get_connection
> connector, args = self.get_connector()
> File "/home/iekho/lib/python2.7/trac/db/api.py", line 195, in
> get_connector
> raise TracError(connector.error)
> TracError: Cannot load Python bindings for PostgreSQL
> 2012-05-23 20:11:24,790 Trac[env] WARNING: base_url option not set in
> configuration, generated links may be incorrect
> 2012-05-23 20:11:24,790 Trac[main] DEBUG: Dispatching <Request "GET '/'">
> 2012-05-23 20:11:24,804 Trac[chrome] DEBUG: Prepare chrome data for request
> 2012-05-23 20:11:24,808 Trac[session] DEBUG: Retrieving session for ID
> 'david'
> 2012-05-23 20:11:24,809 Trac[main] ERROR: can't retrieve session:
> TracError: Cannot load Python bindings for PostgreSQL
> 2012-05-23 20:11:24,810 Trac[chrome] ERROR: Error with navigation
> contributor AdminModule: AttributeError: 'FakePerm' object has no attribute
> 'has_permission'
> 2012-05-23 20:11:24,811 Trac[api] INFO: Synchronized '(default)'
> repository in 0.01 seconds
> 2012-05-23 20:11:24,812 Trac[main] WARNING: HTTPInternalError: 500 Trac
> Error (Cannot load Python bindings for PostgreSQL)
>
> Thanks.
>
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/uy4h6R1cp7IJ.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.


lenny at releaseonellc

Oct 13, 2012, 3:13 AM

Post #3 of 3 (200 views)
Permalink
Re: TracError: Cannot load Python bindings for PostgreSQL [In reply to]

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

On Thursday, October 11, 2012 10:07:54 PM UTC-4, Lenny wrote:
>
> 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
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/T_JgpWiVn_AJ.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.

Trac users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.