oracle / python-cx_Oracle

Python interface to Oracle Database now superseded by python-oracledb
https://oracle.github.io/python-cx_Oracle
Other
887 stars 360 forks source link

import error ModuleNotFoundError install without pip with user with no root access #621

Closed ETVarginha closed 2 years ago

ETVarginha commented 2 years ago

Problem: My user in Unix account doesn't have privileges to install as usual via pip To overcome this situation I downloaded using curl command as below: curl -O -L https://github.com/oracle/python-cx_Oracle/archive/refs/heads/main.zip run the unzip command working directory: /x/recon/test

directory installed the cx_Oracle lib: /x/recon/test/cxOracle-main/python-cx_Oracle-main

test import: test.py import sys sys.path.append('./cxOracle-main/python-cx_Oracle-main/') import cx_Oracle

-- ERROR BEING RAISED: $ pyhton3 test.py File "oracle.py", line 3, in import cx_Oracle ModuleNotFoundError: No module named 'cx_Oracle'

--Addditional details of environemnt

sys.maxsize > 2**32: True platform.python_version: 3.6.8

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0

Env variables LD_LIBRARY_PATH=/orabin/app/oracle/product/19.0.0/dbhome_1/lib:/orabin/app/oracle/product/retail/batch/oracle/lib/bin:/usr/lib:/orabin/app/oracle/product/19.0.0/dbhome_1/lib:/orabin/app/oracle/product/retail/batch/oracle/lib/bin:/usr/lib:/orabin/app/oracle/product/19.0.0/dbhome_1/lib:/orabin/app/oracle/product/19.0.0/dbhome_1/lib ORACLE_BASE=/orabin/app/oracle ORACLE_HOME=/orabin/app/oracle/product/19.0.0/dbhome_1

anthony-tuininga commented 2 years ago

cx_Oracle has to be built before it can be used. See the documentation for details on how to do so. Note that you can use the --user option when using pip to get around lack of permissions. Another option is to use a virtual environment (using the venv module).