Getting an error that ends in "No driver of supported ones %s is available" % str(self.drivers) RuntimeError: No driver of supported ones ('psycopg2',) is available

82 views
Skip to first unread message

Valdeck Rowe

unread,
Apr 14, 2020, 1:58:14 PM4/14/20
to web...@googlegroups.com
Greetings,

Got this error on a production Centos 7 box (on an intranet) after running the centos setup script (setup-web2py-nginx-uwsgi-centos7.sh) to update web2py before updating the application.

Full error message: 
<type 'exceptions.RuntimeError'> Failure to connect, tried 5 times: Traceback (most recent call last): File "/opt/web2py_apps/web2py/gluon/packages/dal/pydal/base.py", line 507, in __init__ self._adapter = adapter(**kwargs) File "/opt/web2py_apps/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 28, in __call__ return AdapterMeta.__call__(cls, *args, **kwargs) File "/opt/web2py_apps/web2py/gluon/packages/dal/pydal/adapters/__init__.py", line 41, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File "/opt/web2py_apps/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 67, in __init__ after_connection, File "/opt/web2py_apps/web2py/gluon/packages/dal/pydal/adapters/base.py", line 417, in __init__ super(SQLAdapter, self).__init__(*args, **kwargs) File "/opt/web2py_apps/web2py/gluon/packages/dal/pydal/adapters/base.py", line 85, in __init__ self.find_driver() File "/opt/web2py_apps/web2py/gluon/packages/dal/pydal/adapters/base.py", line 134, in find_driver "No driver of supported ones %s is available" % str(self.drivers) RuntimeError: No driver of supported ones ('psycopg2',) is available



Pysocpg2 is already installed. The app was working before.

Not sure why I'm getting this error when I'd been running fine before.

Please help. The server has not been used in days and this is mission critical.

Thanks in advance.
Valdeck

Valdeck Rowe

unread,
Apr 14, 2020, 6:43:17 PM4/14/20
to web2py-users
Tried uninstalling and reinstalling psycopg2, restarted the server (nginx) to no avail.

Valdeck Rowe

unread,
Apr 14, 2020, 7:29:12 PM4/14/20
to web2py-users
Also tried installing psycopg2-binary to no avail


On Tuesday, April 14, 2020 at 12:58:14 PM UTC-5, Valdeck Rowe wrote:

Dave S

unread,
Apr 15, 2020, 5:26:31 AM4/15/20
to web2py-users


On Tuesday, April 14, 2020 at 4:29:12 PM UTC-7, Valdeck Rowe wrote:
Also tried installing psycopg2-binary to no avail


Installed in the system python, or locally in the web2py folders?

What does your PYTHONPATH variable look like?

/dps

Valdeck Rowe

unread,
Apr 15, 2020, 2:31:56 PM4/15/20
to web2py-users
PYTHONPATH is blank

Dave S

unread,
Apr 15, 2020, 7:18:56 PM4/15/20
to web2py-users


On Wednesday, April 15, 2020 at 11:31:56 AM UTC-7, Valdeck Rowe wrote:
PYTHONPATH is blank



So is mine, as it turns out (unless it's set in the nginx environment).

On my aws system, I seem to have the psycopg2 directory under gluon/contrib

/dps

Valdeck Rowe

unread,
Apr 15, 2020, 7:52:50 PM4/15/20
to web2py-users
I've copied the psycopg2 package over to the web2py/site-packages folder, added the packages folder to the path. Still nothing


On Tuesday, April 14, 2020 at 12:58:14 PM UTC-5, Valdeck Rowe wrote:

Dave S

unread,
Apr 16, 2020, 4:57:53 PM4/16/20
to web2py-users


On Wednesday, April 15, 2020 at 4:52:50 PM UTC-7, Valdeck Rowe wrote:
I've copied the psycopg2 package over to the web2py/site-packages folder, added the packages folder to the path. Still nothing


My copy isn't in site-packages, it's in gluon/contrib.

Valdeck Rowe

unread,
Apr 18, 2020, 12:09:36 PM4/18/20
to web2py-users
So I checked gluon/contrib and it wasn't there, so I moved it into gluon/contrib. Restarted nginx. Still getting the same error.

Lovedie JC

unread,
Apr 18, 2020, 1:15:35 PM4/18/20
to web...@googlegroups.com
I once had the same error,
Updated Web2py then copied the psycopg2 in the modules folder.
It worked for me. 
Regards 

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/831c08af-7eaa-4963-ae3d-3b809b4fc863%40googlegroups.com.

Valdeck Rowe

unread,
Apr 18, 2020, 3:25:54 PM4/18/20
to web2py-users

Thanks, will try this and let you know how it goes.
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.

Valdeck Rowe

unread,
Apr 18, 2020, 3:42:00 PM4/18/20
to web2py-users
Did not work for me. I wonder what I might be missing.

Valdeck Rowe

unread,
Apr 18, 2020, 8:15:10 PM4/18/20
to web2py-users
Is it possible for me to use the pg8000 driver?


On Tuesday, April 14, 2020 at 12:58:14 PM UTC-5, Valdeck Rowe wrote:

Annet

unread,
Apr 19, 2020, 5:10:21 AM4/19/20
to web2py-users
I had the same problem when installing web2py 2.19.1 on Mac OS X Catalina.

I eventually solved the problem running the following code:

Annets-Mini:~ me$ export PATH=/usr/local/Cellar/postgresql/12.1/bin/:$PATH
Annets-Mini:~ me$ export LDFLAGS="-L/usr/local/opt/readline/lib"
Annets-Mini:~ me$ export CPPFLAGS="-I/usr/local/opt/readline/include"
Annets-Mini:~ me$ export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig"
Annets-Mini:~ me$ export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
Annets-Mini:~ me$ pip install psycopg2
Collecting psycopg2
  Using cached psycopg2-2.8.4.tar.gz (377 kB)
Installing collected packages: psycopg2
    Running setup.py install for psycopg2 ... done
Successfully installed psycopg2-2.8.4
Annets-Mini:~ me$

Your using Linux but maybe this information points you in
the right direction.


Kind regards,

Annet

Dave S

unread,
Apr 24, 2020, 3:08:02 AM4/24/20
to web2py-users


On Saturday, April 18, 2020 at 5:15:10 PM UTC-7, Valdeck Rowe wrote:
Is it possible for me to use the pg8000 driver?


It is, but it's not recommended.  That driver is known to have problems and I believe that it no longer has a maintainer.  I used it for several months, but once I figured out my pip problems (documented in a posting; because of privileges, I was running su pip, and su wasn't using the path I expected), I was quite happy to change.   IIRC, I saw a ramp up in memory usage when I was using pg8000.

/dps

Valdeck Rowe

unread,
May 6, 2020, 2:23:33 AM5/6/20
to web2py-users
Thanks. 

This looks like it would most likely have worked for me. 

However I've moved away from Postgres for that project as it was mission critical and I was running out of time.

I may revisit at a later time.

Really appreciate the responses

Thanks again everyone.
Reply all
Reply to author
Forward
0 new messages