使用 python3.x + cx_Oracle的一些坑

使用 python3.x + cx_Oracle的一些坑

error: DPI-1047: Cannot locate a 64-bit Oracle Client library: "The specified module could not be found". See https://oracle.github.io/odpi/doc/installation.html#windows for help
==================================================================================

1.python控制

python版本:python 3.7.4, 32位版本

使用 python3.x + cx_Oracle的一些坑_第1张图片

2.cx_Oracle的版本:

建议不要直接使用:pip install cx_Oracle  去安装cx_Oracle ,这样的话都是下载的最新版本的cx_Oracle,而且32位和64位版本也不好控制 ,版本问题会出问题。

可以直接去 https://pypi.org/project/cx-Oracle/7.0.0/#files 选择与python对应的版本进行下载:cx_Oracle-7.0.0-cp37-cp37m-win32.whl 

然后 pip install  cx_Oracle-7.0.0-cp37-cp37m-win32.whl

3.Oracle客户端:

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

方法1:把下载的文件解压,复制oci,oraocci11,oraociei11的3个dll粘贴到你的PY目录的Libs/site-packages文件夹下面。

方法2:或者是将下载的文件解压之后,将文件夹的路径配置到环境变量中。

上述方法,2选1即可。

-------------------------------------------------------------------------------------------------

使用 python3.x +pytest 的一些坑

pytest的版本控制:

pytest 3.5.0

pytest-allure-adaptor 1.7.10

安装命令:pip install pytest==3.5.0

安装命令:pip install pytest-allure-adaptor==1.7.10

其他的补充:

python的版本控制:

使用的是直接从官网下载的python3.7.4的32位版本,直接访问python官网:https://www.python.org/downloads/ ,这样的话

一般都是下载的试32位的python:

使用 python3.x + cx_Oracle的一些坑_第2张图片

如果有需要下载64位python,应该这样下载:

使用 python3.x + cx_Oracle的一些坑_第3张图片

然后页面滑动到最下面,选择 Windows x86-64 executable installer  版本即可,这样你下载的就是64位版本的python了。

使用 python3.x + cx_Oracle的一些坑_第4张图片

你可能感兴趣的:(问题解决)