Python 3.5.3 和 Oracle 11.2 on Windows 7:找不到 oracle 包含文件
Python 3.5.3 and Oracle 11.2 on Windows 7: cannot locate oracle include files
我刚刚安装了 Python 3.5.3
,我还有一个 Oracle Client
目录,在 include
子目录中有很多 *.h
文件...
但是当我尝试
pip install cx_oracle
我得到:
distutils.errors.DistutilsSetupError: cannot locate Oracle include files in C:\oracle\instantclient_11_2
我对 Python 完全陌生,我 真的 想在 Web 应用程序中使用它(这将是我们第一次使用 Python 在我工作的公司),我当然需要你的帮助。
提前致谢!
您需要从 Oracle 安装依赖项。
最后,感谢 Alex,我解决了我的问题。
我所做的是:
- 从 here 下载
Windows 7
64 位 的 Instant Client Basics
和 Install Client SDK
。
- 将所有内容放在同一个目录中 (
C:\oracle\instantclient_12_1
)
- 检查了我的系统
path
和 ORACLE_HOME
变量。使用 echo %VARIABLE_NAME%
检查变量,然后使用 this procedure 设置它。 ORACLE_HOME
必须设置为 C:\oracle\instantclient_12_1
(在我的情况下,您的可能不同)并且 PATH
必须包含相同的字符串。
- 前往 here 下载
Visual C++ Build Tools 2015
,因为需要 C++
。
- 最后
pip install cx_oracle
确保您拥有 一切 32 或 64 位:安装客户端,Windows 版本,Python。
我运行Python 3.5.3
,不知道目前有没有cx_oracle
可以安装在Python 3.6
.
我刚刚安装了 Python 3.5.3
,我还有一个 Oracle Client
目录,在 include
子目录中有很多 *.h
文件...
但是当我尝试
pip install cx_oracle
我得到:
distutils.errors.DistutilsSetupError: cannot locate Oracle include files in C:\oracle\instantclient_11_2
我对 Python 完全陌生,我 真的 想在 Web 应用程序中使用它(这将是我们第一次使用 Python 在我工作的公司),我当然需要你的帮助。
提前致谢!
您需要从 Oracle 安装依赖项。
最后,感谢 Alex,我解决了我的问题。
我所做的是:
- 从 here 下载
Windows 7
64 位 的Instant Client Basics
和Install Client SDK
。 - 将所有内容放在同一个目录中 (
C:\oracle\instantclient_12_1
) - 检查了我的系统
path
和ORACLE_HOME
变量。使用echo %VARIABLE_NAME%
检查变量,然后使用 this procedure 设置它。ORACLE_HOME
必须设置为C:\oracle\instantclient_12_1
(在我的情况下,您的可能不同)并且PATH
必须包含相同的字符串。 - 前往 here 下载
Visual C++ Build Tools 2015
,因为需要C++
。 - 最后
pip install cx_oracle
确保您拥有 一切 32 或 64 位:安装客户端,Windows 版本,Python。
我运行Python 3.5.3
,不知道目前有没有cx_oracle
可以安装在Python 3.6
.