pyinstaller打包cx_Oracle库问题处理记录

pyinstaller打包cx_Oracle库问题处理记录

这两天打包程序,遇到坑无数,记录一下。


综合网上各类参考信息摘录,地址如下:https://www.cnblogs.com/BigFishFly/p/6337014.html

1.下载cx_Oracle

在windows下不要使用easy_install或者pip,因为这样安装不会同步环境,并报错:

distutils.errors.DistutilsSetupError: cannot locate Oracle include files in...

因此下载cx_Oracle5.3.exe文件安装

https://files.pythonhosted.org/packages/48/83/15dd03c752d8840ce763bfad5ebd02568f16b2d6709a2b7e6ff97bc3c0f3/cx_Oracle-5.3-11g.win-amd64-py2.7.exe


2. 下载Oracle Instant Client或使用完整的数据库客户端安装包,版本需11.2以上。

数据库客户端版本和python版本及位数需一致。

下载地址:

64位:https://www.oracle.com/technetwork/topics/winx64soft-089540.html

32位:http://www.oracle.com/technetwork/topics/winsoft-085727.html

下载后解压到某一路径,并将该路径添加到系统的环境变量,命名为ORACLE_HOME,将ORACLE_HOME添加到path下,否则会报错

cx_Oracle.InterfaceError: Unable to acquire Oracle environment handle

该目录下可自建network\admin文件夹,存放tnsnames.ora, sqlnet.ora or oraaccess.xml文件


3.安装VC环境

Oracle Instant Client libraries需要VC环境,并匹配对应的位数和版本,对应关系如下:

For Instant Client 18 or 12.2 install VS 2013

For Instant Client 12.1 install VS 2010

For Instant Client 11.2 install VS 2005 64-bit or VS 2005 32-bit


4.解决中文乱码问题

4.1设置环境变量(全局&#

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值