db2 导入ibm_db时找不到libcrypt.so.1

zlwx9yxi  于 2022-11-23  发布在  DB2
关注(0)|答案(1)|浏览(294)

在python中导入ibm_db时,我得到了以下回溯-

Traceback (most recent call last):
File "/working/Script.py", line 5, in <module>
import ibm_db
ImportError: Error loading shared library libcrypt.so.1: No such file or directory (needed by 
/usr/local/lib/python3.9/site-packages/clidriver/lib/libdb2.so.1)

请在下面找到我的Docker图像和requirements.txt文件-

FROM python:3.9-alpine3.16

COPY requirements.txt requirements.txt

RUN apk --update add --virtual build-dependencies python3 py-pip openssl ca-certificates py-openssl wget libffi-dev openssl-dev python3-dev py-pip py3-pandas build-base \
  && apk add python3 make g++ \
  && pip install --upgrade pip \
  && pip install -r requirements.txt \
  && apk del build-dependencies

ENTRYPOINT [ "python", "Script.py" ]

需求. txt-

cryptography==2.9
botocore==1.12.253
azure-storage-blob==2.1.0
azure-storage-common==2.1.0
snowflake-connector-python==1.9.1
snowflake-sqlalchemy==1.2.4
SQLAlchemy==1.3.19
ibm_db
s3fs
wlzqhblo

wlzqhblo1#

IBM clidriver(python ibm_db模块依赖于它)在Alpine-Linux上不受支持-也就是说,它在Alpine-Linux上不起作用。
该驱动程序(clidriver)是封闭源代码的,对于Linux x64,它是使用gcc构建的。
您必须选择受支持的基本Linux、Ubuntu、Red Hat、SuSe。

相关问题