IDLE shell 无法找到 cx_Oracle 的图像(原因:找不到图像)

IDLE shell not able to find image for cx_Oracle (Reason: image not found)

您好 - 我已经在 Mac OS X Yosemite 10.10 上成功安装了 cx_Oracle 并且我可以通过以下方式查询我的 oracle 数据库mac 终端在终端中使用 Python 2.7.11。

唯一的问题是 IDLE shell 应用程序无法导入 cx_Oracle 并显示以下错误:

Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 12:54:16) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> import cx_Oracle

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import cx_Oracle
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cx_Oracle.so, 2): Library not loaded: /ade/b/3071542110/oracle/rdbms/lib/libclntsh.dylib.11.1
  Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cx_Oracle.so
  Reason: image not found

下面是我在 Mac 终端中看到的内容(然后我可以继续成功查询数据库):

Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 12:54:16) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
>>> 

IDLE 不允许导入 cx_Oracle 我错过了什么?

与其 运行从固定图标中空闲,运行 它带有 python -m idlelib.idle。 (对于 3.x,不需要 .idle。)我不知道为什么在这种情况下效果更好,但我知道图标中的 运行ning 有时会隐藏所需的信息,例如将是 运行 的二进制文件、当前工作目录 python 将 运行、启动参数和一些错误消息。