我安裝了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安裝程序。但我幾乎用完了想法。