HI Massimo, I could import psycopg2 in web2py shell manually. I used the installation script inside web2py scripts folder. Bellow the entire error:
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. Traceback (most recent call last): File "/home/www-data/py27env/web2py/gluon/restricted.py", line 219, in restricted exec(ccode, environment) File "/home/www-data/py27env/web2py/applications/nwproducao/controllers/carreira.py" <https://nwcosmeticos.ml/admin/edit/nwproducao/controllers/carreira.py>, line 812, in <module> File "/home/www-data/py27env/web2py/gluon/globals.py", line 419, in <lambda> self._caller = lambda f: f() File "/home/www-data/py27env/web2py/applications/nwproducao/controllers/carreira.py" <https://nwcosmeticos.ml/admin/edit/nwproducao/controllers/carreira.py>, line 19, in gera_plano_carreira vgraduacao = gera_graduacao() File "/home/www-data/py27env/web2py/applications/nwproducao/controllers/carreira.py" <https://nwcosmeticos.ml/admin/edit/nwproducao/controllers/carreira.py>, line 54, in gera_graduacao for r in rows: File "/home/www-data/py27env/web2py/gluon/packages/dal/pydal/objects.py", line 3039, in __iter__ row = next(self) File "/home/www-data/py27env/web2py/gluon/packages/dal/pydal/objects.py", line 3014, in __next__ db_row = self.cursor.fetchone() File "/home/www-data/py27env/web2py/gluon/contrib/pg8000/core.py", line 947, in fetchone return next(self) File "/home/www-data/py27env/web2py/gluon/contrib/pg8000/core.py", line 1032, in __next__ self._c.handle_messages(self) File "/home/www-data/py27env/web2py/gluon/contrib/pg8000/core.py", line 2088, in handle_messages raise self.error ProgrammingError: (u'ERROR', u'34000', u'portal "pg8000_portal_11313" does not exist', u'postgres.c', u'1861', u'exec_execute_message', u'', u'') Thanks Best regards André Em domingo, 25 de fevereiro de 2018 21:02:54 UTC-3, Massimo Di Pierro escreveu: > > If it finds psycopg2 it should be using it over pg8000. Is t possible you > have two versions of python installed? > > > > On Sunday, 25 February 2018 04:46:57 UTC-6, Morganti wrote: >> >> Hi Massimo, thanks your answer. >> >> How can force web2py uses psycop2? I install pyscop2 using pip and made a >> test importing it in normal python shell. But I got the same error when >> tried to execute the same function: >> >> <class 'gluon.contrib.pg8000.core.ProgrammingError'>((u'ERROR', u'34000', >> u'portal "pg8000_portal_294" does not exist', u'postgres.c', u'1861', >> u'exec_execute_message', u'', u'')) >> >> It is using pg8000 and not pyscop2. >> >> Thanks, >> Best regards >> André >> >> Em sábado, 24 de fevereiro de 2018 23:36:32 UTC-3, Massimo Di Pierro >> escreveu: >>> >>> I know. It is there and we distribute it but we will remove it in the >>> next version. >>> I run into lots of problems with it, even with simple apps. psycopg2 >>> works instead. >>> >>> >>> On Friday, 23 February 2018 04:57:41 UTC-6, Morganti wrote: >>>> >>>> Hi Dave, >>>> >>>> I found "pg8000" inside "gluon/contrib". >>>> >>>> In "gluon\packages\dal\pydal\adapters" I found the "postgres.py". So is >>>> it wrong? Do I need to move pg8000 to "gluon\packages\dal\pydal\adapters"? >>>> >>>> You said about socket. I have no idea how to do it. >>>> >>>> Thanks a lot your support! >>>> Best regards >>>> Andre >>>> >>>> Em quinta-feira, 22 de fevereiro de 2018 18:30:17 UTC-3, Dave S >>>> escreveu: >>>>> >>>>> >>>>> >>>>> On Thursday, February 22, 2018 at 8:29:43 AM UTC-8, Morganti wrote: >>>>>> >>>>>> Hi, thanks your time. >>>>>> >>>>>> How can I check it? If I try to open web2py shell (web2py -S app -M), >>>>>> I had no errors and all tables could be used. >>>>>> >>>>>> Thanks >>>>>> BR >>>>>> André >>>>>> >>>>>> >>>>> That's one way to check. The actual files should show up in the >>>>> web2py/gluon/packages/dal/pydal/adapters, I think, and not just in >>>>> gluon/contrib. >>>>> >>>>> >>>>> But the error looks, to my inexpert eye, like a socket error. So I >>>>> would start by verifying the socket exists and has the proper >>>>> permissions. >>>>> >>>>> /dps >>>>> >>>>> Em quinta-feira, 22 de fevereiro de 2018 13:08:23 UTC-3, Ovidio >>>>>> Marinho escreveu: >>>>>>> >>>>>>> make sure the pg8000 and psycopg2 libraries are installed at the >>>>>>> start of web2py >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> [image: http://itjp.net.br] <http://itjp.net.br> >>>>>>> http://itjp.net.b <http://itjp.net.br>r >>>>>>> *Ovidio Marinho Falcao Neto* >>>>>>> ovid...@gmail.com >>>>>>> Brasil >>>>>>> >>>>>>> >>>>>>> 2018-02-22 12:40 GMT-03:00 Morganti <acmor...@gmail.com>: >>>>>>> >>>>>>>> Hello, >>>>>>>> >>>>>>>> I have a VPS using ubuntu 16.04, nginx, Postgres and web2py 2.16.1. >>>>>>>> >>>>>>>> I tried to execute one controller that populate some tables and got >>>>>>>> the error below. >>>>>>>> >>>>>>>> Then, I used that command to create a csv file with all tables and >>>>>>>> uploaded it in my desktop using SQLITE and no error were found. >>>>>>>> >>>>>>>> The controller coud create some rows before the error. >>>>>>>> >>>>>>>> Traceback (most recent call last): >>>>>>>> File "/home/www-data/py27env/web2py/gluon/restricted.py", line 219, >>>>>>>> in restricted >>>>>>>> exec(ccode, environment) >>>>>>>> File >>>>>>>> "/home/www-data/py27env/web2py/applications/nwproducao/controllers/carreira.py", >>>>>>>> line 633, in <module> >>>>>>>> File "/home/www-data/py27env/web2py/gluon/globals.py", line 419, in >>>>>>>> <lambda> >>>>>>>> self._caller = lambda f: f() >>>>>>>> File >>>>>>>> "/home/www-data/py27env/web2py/applications/nwproducao/controllers/carreira.py", >>>>>>>> line 21, in gera_plano_carreira >>>>>>>> vgraduacao = gera_graduacao() >>>>>>>> File >>>>>>>> "/home/www-data/py27env/web2py/applications/nwproducao/controllers/carreira.py", >>>>>>>> line 56, in gera_graduacao >>>>>>>> for r in rows: >>>>>>>> File >>>>>>>> "/home/www-data/py27env/web2py/gluon/packages/dal/pydal/objects.py", >>>>>>>> line 3039, in __iter__ >>>>>>>> row = next(self) >>>>>>>> File >>>>>>>> "/home/www-data/py27env/web2py/gluon/packages/dal/pydal/objects.py", >>>>>>>> line 3014, in __next__ >>>>>>>> db_row = self.cursor.fetchone() >>>>>>>> File "/home/www-data/py27env/web2py/gluon/contrib/pg8000/core.py", >>>>>>>> line 947, in fetchone >>>>>>>> return next(self) >>>>>>>> File "/home/www-data/py27env/web2py/gluon/contrib/pg8000/core.py", >>>>>>>> line 1032, in __next__ >>>>>>>> self._c.handle_messages(self) >>>>>>>> File "/home/www-data/py27env/web2py/gluon/contrib/pg8000/core.py", >>>>>>>> line 2088, in handle_messages >>>>>>>> raise self.error >>>>>>>> ProgrammingError: (u'ERROR', u'34000', u'portal "pg8000_portal_13259" >>>>>>>> does not exist', u'postgres.c', u'1861', u'exec_execute_message', u'', >>>>>>>> u'') >>>>>>>> >>>>>>>> *Thanks your helping.* >>>>>>>> >>>>>>>> *Best regards* >>>>>>>> >>>>>>>> *Andre* >>>>>>>> >>>>>>>> -- >>>>>>>> Resources: >>>>>>>> - http://web2py.com >>>>>>>> - http://web2py.com/book (Documentation) >>>>>>>> - http://github.com/web2py/web2py (Source code) >>>>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues) >>>>>>>> --- >>>>>>>> You received this message because you are subscribed to the Google >>>>>>>> Groups "web2py-users" group. >>>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>>> send an email to web2py+un...@googlegroups.com. >>>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>>> >>>>>>> >>>>>>> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.