Hi Team,
I discovered Pyscript recently and love every bit of it
I have written a script where I am trying to connect to the SAP HANA Cloud database using the module HDBCLI. But it is giving me the below error:
JsException(PythonError: Traceback (most recent call last): File “/lib/python3.10/site-packages/_pyodide/_base.py”, line 429, in eval_code .run(globals, locals) File “/lib/python3.10/site-packages/_pyodide/_base.py”, line 300, in run coroutine = eval(self.code, globals, locals) File “”, line 1, in ModuleNotFoundError: No module named ‘hdbcli’ )
HANA client is already installed in my system and also HDBCLI module is installed by running the command - pip install hdbcli.
Does anyone know if this module is currently supported by pyscript? Any idea how we can make this work?
Regards
Arun
1 Like
Generally you can’t make any external API calls except for using HTTP(S) based REST APIs using something like PyFetch.
Databases that rely on client drivers or ODBC connections in particularly won’t work because the browser will never let you make local system calls or open arbitrary local sockets due to security reasons.
2 Likes
Thank You Damian for the reply I wanted to know if Pyscript will be supporting this feature anytime soon in the future? I mean sort of workaround?
1 Like
PyScript can only do what a browser let’s it do and a browser is never going to allow these features, it would be a giant security risk.
The only workaround I can think of is to create a service that let’s you make Rest API calls and forwards them as queries to the database, it would be a lot of effort though and would mean you need to run a process outside the browser in which case you may as well use regular Python?