0

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?

barbsan
  • 3,418
  • 11
  • 21
  • 28
전남식
  • 1
  • 3

2 Answers2

2

Update: Oracle has released Oracle Instant Client ARM64: https://www-sites.oracle.com/database/technologies/instant-client/linux-arm-aarch64-downloads.html

Christopher Jones
  • 9,449
  • 3
  • 24
  • 48
0

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.

Koxo
  • 507
  • 4
  • 10
  • I've tried your method. There are no errors in the terminal. However, I would like to code in the PUTTY window, but import cx_Oracle will get an error that there are no modules. By any chance, can you tell me how to solve it? – 전남식 Feb 22 '19 at 12:31
  • maybe you are using python3? try `pip3 install cx_Oracle` – Koxo Feb 22 '19 at 13:55
  • Thank you. This problem has been solved. But then there was this problem. Run cx_Oracle.connect cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 32-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help This is a problem. Can you help me? – 전남식 Feb 25 '19 at 12:35
  • Hi. As @Christopher Jones mentioned above, problem is, that there is no version of cx_Oracle for ARM architecture. Unfortunately it not gonna work. I cant help you. – Koxo Feb 25 '19 at 13:10