Web2py Oracle连接失败

2024-06-16 14:50:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试将web2py连接到我的本地Oracle DB,从pip3安装了cx_Oracle,并安装了Oracle Instant Client

echo $LD_LIBRARY_PATH
/usr/lib/oracle/19.6/client64/lib:

Web2py版本Version 2.19.1-stable+timestamp.2020.03.21.13.06.49

我的db.py文件

db = DAL('oracle://username/password@test')

但我犯了这个错误:

<class 'RuntimeError'> Failure to connect, tried 5 times: Traceback (most recent call last): File "/home/user/project/web2py/gluon/packages/dal/pydal/base.py", line 507, in __init__ self._adapter = adapter(**kwargs) File "/home/user/project/web2py/gluon/packages/dal/pydal/adapters/__init__.py", line 41, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File "/home/user/project/web2py/gluon/packages/dal/pydal/adapters/base.py", line 417, in __init__ super(SQLAdapter, self).__init__(*args, **kwargs) File "/home/user/project/web2py/gluon/packages/dal/pydal/adapters/base.py", line 85, in __init__ self.find_driver() File "/home/user/project/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 ('cx_Oracle',) is available 

谢谢


Tags: inpyprojecthomebaseinitpackagesline