David and Pierro, Thank you both for these suggestions. I'm pretty sure you both have identified my problem. I think I have three Python installations now what with the original, then an old install of IDLE and its Python, and now MacPorts. I think when I used MacPorts to install psycopg2 it defaulted to 2.4. I've since then tried to repeat the MacPorts install but asking for py25-psycopg2 and it almost works, fetching and building a lot of things, but then fails before finishing. I'm thinking of trying a different machine or somehow uninstalling most of my Python code and starting again. Thanks again for your help. --Steve
On Nov 9, 3:53 am, David <digitalcry...@gmail.com> wrote: > Hi Steve, > > The biggest headache for me while setting up my Mac was the > pythonpath. Even though I had Python in OSX, for some reason I had > also Python from MacPorts installed and the two different > installations were confusing me. > > I resorted to setting it in .bashrc so every time I launched a > terminal it would get set and I'd be done with it. > > - David > > On Nov 8, 5:20 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > Make sure you run web2py source (not binary) and use the same Python > > version that you installed psycopg2 for. > > > On Nov 8, 5:14 pm, Steve <sltanim...@gmail.com> wrote: > > > > After some initial success with Web2py on a PC, I set it up on a > > > Macbook Pro. It worked but had problems with the database being > > > locked when multiple web requests came in and compute times were long > > > (running student game agents online). So I installed Postgresql and > > > psycopg2. However, I am having a problem getting gluon to find it. > > > I have my db=DAL('postgres://myacct:mypas...@localhost:5432/ > > > aitourney') > > > > The error I get is this: > > > NameError: global name 'psycopg2' is not defined > > > > The traceback says this is in line 902 of gluon/sql.py in <lambda> > > > > How do I get past this error? Is there a particular config file where > > > I have to indicate how to find psycopg2?. > > > How is that done? I used Macports to install psycopg2 in the default > > > location. > > > > Thanks. Web2py generally seems to be an awesome tool. > > > > --Steve --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" 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 -~----------~----~----~----~------~----~------~--~---