【发布时间】:2021-07-30 16:30:38
【问题描述】:
我尝试在 .py 中编写一个用于 oracle 连接的脚本:
#!/usr/bin/python
import cx_Oracle
connstr='username/pwd@database'
conn = cx_Oracle.connect(connstr)
curs = conn.cursor()
curs.execute('select * from table1;')
print curs.description
for row in curs:
print row
conn.close()
我收到以下错误:
Traceback (most recent call last):
File "test_SQLPython.py", line 3, in ?
import cx_Oracle
ImportError: No module named cx_Oracle
任何帮助将不胜感激? 谢谢。
【问题讨论】:
-
cx_Oracle.py 位于何处?它可能在您的 python PATH 中未列出的某个地方
标签: python