简体   繁体   English

使用 pip (python) 为 ibm_db 安装错误

[英]install error for ibm_db with pip (python)

I have tried upgrading pip, installing/upgrading setup tools, a lot of these simple things suggested on here.我试过升级 pip,安装/升级设置工具,这里建议了很多这些简单的事情。 Can anyone help?任何人都可以帮忙吗? Thanks,谢谢,

I've been able to install every other python library without issue.我已经能够毫无问题地安装所有其他 python 库。

Collecting ibm_db==3.0.3 Using cached ibm_db-3.0.3.tar.gz (794 kB) ERROR: Command errored out with exit status 1:收集 ibm_db==3.0.3 使用缓存的 ibm_db-3.0.3.tar.gz (794 kB) 错误:命令出错,退出状态为 1:

TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

The evidence is:证据是:

sock.connect(sa) TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond sock.connect(sa) TimeoutError: [WinError 10060] 连接尝试失败,因为连接方在一段时间后没有正确响应,或者连接失败,因为连接的主机没有响应

The python ibm_db module by default will try to download from IBM the tiny footprint db2cli driver.默认情况下,python ibm_db 模块将尝试从 IBM 下载占用空间很小的db2cli驱动程序。 This is what is failing in your case.这就是您的情况失败的原因。

This failure can be either a configuration error (on your environment, or your network), or it can be that the IBM website that hosts the db2cli package is temporarily unavailable.此故障可能是配置错误(在您的环境或网络上),也可能是托管 db2cli package 的 IBM 网站暂时不可用。 More suggestions here .更多建议在这里 Remember that the db2cli driver is independent of python ibm_db, and can be separately installed.请记住, db2cli驱动程序独立于 python ibm_db,可以单独安装。

But, if you already have installed a Db2 CLI driver on your workstation, then you can tell python ibm_db to not download db2cli during pip install ibm_db by setting the IBM_DB_HOME environment variable before running the pip install ibm_db . But, if you already have installed a Db2 CLI driver on your workstation, then you can tell python ibm_db to not download db2cli during pip install ibm_db by setting the IBM_DB_HOME environment variable before running the pip install ibm_db . This is documented on the python ibm_db homepage on github, which you should read.这记录在 github 上的 python ibm_db主页上,您应该阅读。 You can download and install a Db2 CLI driver from the IBM website ('Passport Advantage') or you can get a CLI driver from your Db2 DBA at your site.您可以从 IBM 网站(“Passport Advantage”)下载并安装 Db2 CLI 驱动程序,或者您可以从您的站点上的 Db2 DBA 获取 CLI 驱动程序。 If you already installed a Db2-server on your MS-Windows workstation the it already includes the full Db2 CLI client.如果您已经在 MS-Windows 工作站上安装了 Db2 服务器,那么它已经包含完整的 Db2 CLI 客户端。

So there are 4 possible CLI drivers from IBM you can use with python ibm_db, (1) the full Db2-client (2) the Db2 runtime client (3) the db2cli tiny footprint client, (4) ( for connecting to i-series AS/400 only, the IBM i access odbc package. Any of these can be pre-installed and pre-configured before installing python ibm_db as long as you set the IBM_DB_HOME variable before running pip install ibm_db .因此,有 4 种可能来自 IBM 的 CLI 驱动程序可以与 python ibm_db 一起使用,(1) 完整的 Db2 客户端 (2) Db2 运行时客户端 (3) db2cli微型足迹客户端,(4)(用于连接到 i 系列AS/400 only, the IBM i access odbc package. Any of these can be pre-installed and pre-configured before installing python ibm_db as long as you set the IBM_DB_HOME variable before running pip install ibm_db .

Before python ibm_db can connect to a Db2 database, there must exist at least one Db2 CLI driver on your PATH.在 python ibm_db 可以连接到 Db2 数据库之前,您的 PATH 中必须至少存在一个 Db2 CLI 驱动程序。 You can install and configure a Db2 CLI driver independently of python ibm_db if you wish to avoid install-time dependencies on the db2cli driver.如果您希望避免安装时依赖于 db2cli 驱动程序,则可以独立于 python ibm_db 安装和配置 Db2 CLI 驱动程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM