求大佬指点,Python3.9 64 位 cx_Oracle验证下载加连接数据库验证过程(离线)
在导入cx_Oracle时候报错如上所示,则需要下载cx_Oracle模块
下载一定要注意:Oracle客户端,python版本,cx_Oracle三者版本必须匹配,否则导入会报......!32类似错误说明这三者版本不匹配。
举例:Oracle客户端 32位11g,python也必须是32位,cx_Oracle版本则是cx_Oracle-5.3-11g.win32-py3.6
这三个版本一定要匹配,匹配,匹配
最后将Oracle客户端安装路径下的 oci.dll oraocci11.dll oraociei11.dll这三个文件拷贝到python安装路径的LIB/site-packages
这样就OK了。
什么系统:Windows还是linux还是Mac
按照官网所说:
环境Python3.5以上,cx_Oracle最新为8.2.1
离线安装需要大概需要步骤:
2、 安装whl
python -m pip install "<file_name>"
官网描述如下:(跟上面三步对应)
Installing cx_Oracle without Internet Access
To install cx_Oracle on a computer that is not connected to the internet, download the appropriate cx_Oracle file from PyPI. Transfer this file to the offline computer and install it with:
python -m pip install "<file_name>"
Then follow the general cx_Oracle platform installation instructions to install Oracle client libraries.
没有人讲到重点,本来想用Python3.9的,然后降Python版本降包版本。最后卸载了所有与cx_Oracle有关的东西,重新下载3.6.2和匹配的cx_Oracle版本(exe,内网无法pip)。Oracle客户端。然后把客户端加到服务器,dll组件加到sites-packages,就可以了
instantclient文件夹的.dll文件没copy到Python的dlls目录下吧?
你看看这个,可能是因为网络慢的原因
https://www.cnblogs.com/bonelee/p/9336886.htmlhttps://www.cnblogs.com/bonelee/p/9336886.html
首先,在哪上面执行的?windows还是linux?如果是linux,需要安装包括两个东西,一个是cx_Oracle的python lib,另外,需要安装oracle的client,并且版本要相互匹配