Python2.7环境下cx_oracle的安装

小记:Python2.7下面不能安装最新的6.4.1版本,否则会报错。

SAWarning: cx_Oracle is compiled under Python 2.xx using the WITH_UNICODE flag. Consider recompiling cx_Oracle without this flag, which is in no way necessary for full support of Unicode. Otherwise, all string-holding bind parameters must be explicitly typed using SQLAlchemy's String type or one of its subtypes,or otherwise be passed as Python unicode. Plain Python strings passed as bind parameters will be silently corrupted by cx_Oracle. "cx_Oracle is compiled under Python 2.xx using the "

……

typeerror:'twophase' is an invalid keyword errors connecting to Oracle

DatabaseError: (cx_Oracle.DatabaseError) DPI-1047: 64-bit Oracle Client library cannot be loaded: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help (Background on this error at: http://sqlalche.me/e/4xp6)

要安装5.1.3,并且在安装5.1.3前先安装VCForPython27.msi

一、下载Oracle客户端驱动(Oracle Instant Client Basic)并安装

下载地址:http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html

二、安装VCForPython27.msi

error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27

打开http://aka.ms/vcpython27会跳转到http://www.microsoft.com/en-us/download/confirmation.aspx?id=44266

将安装包(VCForPython27.msi, 83Mb)下载回来安装即可解决问题

Microsoft Visual C++ Compiler for Python 2.7

下载地址:https://www.microsoft.com/en-us/download/details.aspx?id=44266

三、安装cx_oracle

pip install cx_oracle==5.1.3

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容