You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to install the h3 library in Redshift using Pip and the utility install script installPipModuleAsRedshiftLibrary.sh.
I am building h3 on Ubuntu 16.04. I am able to successfully upload the h3.zip file to my S3 bucket.
However, when I try to run the UDF, I get this error
OSError: /rdsdbdata/user_lib/0/0/288461.zip/h3/out/libh3.so.1: cannot open shared object file: Not a directory
Full stack trace from svl_udf_log:
File "h3.py", line 39, in <module>
File "__init__.py", line 443, in LoadLibrary
return self._dlltype(name)
File "__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)```
The UDF I'm trying to use:
```CREATE OR REPLACE function get_hexbin(coord_lat double precision, coord_lon double precision, res INTEGER)
RETURNS VARCHAR IMMUTABLE
AS $$
from h3 import h3
return 'hello world'
$$ LANGUAGE plpythonu;
While installing h3 locally, I see this message about skipping wheel but then it uploads a zip file to S3 anyway:
Collecting h3
Saved /home/bhavika/Desktop/.h3/h3-3.1.0-cp36-cp36m-linux_x86_64.whl
Skipping h3, due to already being wheel.
The text was updated successfully, but these errors were encountered:
I have exactly the same issue. Locally the library works well (tested in docker i386/ubuntu:latest). It seems that Redshift doesn't allow loading C libraries from the Python code - or to be more precise, it doesn't allow open any non-Python files within the library. More details are described in this article:
Only one thing is missing! They don’t let you to read files either. If your Python package want to open any file then the package will fail instantly.
Failing library part is the following:
libh3 = cdll.LoadLibrary(libh3_path)
and even after changing the library path to be an absolute path:
I'm trying to install the h3 library in Redshift using Pip and the utility install script
installPipModuleAsRedshiftLibrary.sh
.I am building
h3
on Ubuntu 16.04. I am able to successfully upload the h3.zip file to my S3 bucket.However, when I try to run the UDF, I get this error
OSError: /rdsdbdata/user_lib/0/0/288461.zip/h3/out/libh3.so.1: cannot open shared object file: Not a directory
Full stack trace from
svl_udf_log
:While installing
h3
locally, I see this message about skipping wheel but then it uploads a zip file to S3 anyway:The text was updated successfully, but these errors were encountered: