美文网首页
Python2.7环境下cx_oracle的安装

Python2.7环境下cx_oracle的安装

作者: 唐山_risk | 来源:发表于2018-09-04 18:26 被阅读116次

    小记: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

    相关文章

      网友评论

          本文标题:Python2.7环境下cx_oracle的安装

          本文链接:https://www.haomeiwen.com/subject/rcjnwftx.html