Raspberry pi No module named 'cx_Oracle'

2020-02-02 04:07发布

I want to use the raspberry pi to send values to the Oracle11g database, but when I run import cx_Oracle syntax for that process, I get the following error:

Traceback (most recent call last):
  File "/home/pi/20190222ex01.py", line 1, in <module>
    import cx_Oracle
  File "/usr/lib/python3/dist-packages/thonny/backend.py", line 317, in _custom_import
    module = self._original_import(*args, **kw)
ImportError: No module named 'cx_Oracle'

How can I solve this problem?

2条回答
乱世女痞
2楼-- · 2020-02-02 04:24

There is no ARM port of the Oracle Client libraries that are needed by cx_Oracle. You'll have to use something like REST calls from Python to a mid-tier server (in whatever language you like) running on an operating system that will support connection to the Oracle DB.

查看更多
迷人小祖宗
3楼-- · 2020-02-02 04:33

It means, that you have not installed module cx_Oracle.

First you must install Oracle driver with PIP:

python -m pip install cx_Oracle --upgrade

Hope it helped you.

查看更多
登录 后发表回答