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设置环境变量(全局&#