There are two options here:
- installation was not successful
- you have two python versions (one has psycopg2 and you are using the
other to start web2py).

Ignore web2py and see if you can do

python
>>> import psycopg2

Which directory you use to install psycopg2 should not make any
difference.

Massimo

On Jun 14, 9:15 am, Johann Spies <johann.sp...@gmail.com> wrote:
> I am new to web2py and want to use postgresql.  The example from the
> examples resulted in the following ticket:
>
> Ticket 192.168.0.253.2009-06-14.15-49-37.29bfdc0b-80d5-4e45-abf1-fa13eec8fa36
>
> Error traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
>
> Traceback (most recent call last):
>   File "gluon/restricted.py", line 107, in restricted
>     exec ccode in environment
>   File "/var/www/web2py/applications/fotos/models/db.py", line 1, in <module>
>     db = SQLDB("postgres://fotos:somepassw...@localhost:5432/fotos")
>   File "gluon/sql.py", line 759, in __init__
>     self._pool_connection(lambda : psycopg2.connect(msg))
>   File "gluon/sql.py", line 637, in _pool_connection
>     self._connection = f()
>   File "gluon/sql.py", line 759, in <lambda>
>     self._pool_connection(lambda : psycopg2.connect(msg))
> NameError: global name 'psycopg2' is not defined
>
> I did install python-psycopg2 and I he tried to run setup-app.py in
> the web2py directory but I can't figure out how to use it.
>
> I have read several confusing threads about this issue on between
> web2py users.  What am I suppose to do to get this connection working?
>
> I am using Version 1.64.1 (2009-06-11 15:48:02) on Ubuntu Jaunty.
> Regards
> Johann
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to