我安装了python-2.7.amd64.msi和cx_Oracle-5.1.2-11g.win-amd64-py2.7.msi。Python无法在Windows 7上加载cx_Oracle
我使用PATH和PYTHONPATH环境变量探讨了很多,但没有任何帮助加载cx_Oracle模块。目前PYTHONPATH设置为 C:\ Python27 \ LIB \站点包
我非常基本的程序
import sys
print sys.path
import cx_Oracle
conn_str = u'xxx/[email protected]/XXX'
conn = cx_Oracle.connect(conn_str)
c = conn.cursor()
c.execute(u'select * from table')
conn.close()
程序输出是:
['C:\\Users\\terry\\IdeaProjects\\PythonScripts', 'C:\\Python27\\Lib\\site-packages', 'C:\\WINDOWS\\system32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27']
Traceback (most recent call last):
File "OracleTest.py", line 4, in <module>
import cx_Oracle
ImportError: DLL load failed: The specified module could not be found.
我还添加注册表条目详细here
这在Linux上正常工作,所以它似乎我有问题的Windows安装程序。但我几乎用完了想法。