Raspberry pi No module named 'cx_Oracle'

2020-02-02 03:39发布

问题:

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?

回答1:

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.



回答2:

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.