python - cx_Oracle in Ubuntu: distutils.errors.DistutilsSetupError: cannot locate an Oracle software installation - Ask Ubuntu
i try install python dependencies django project sdu.edu.kz. project uses cx-oracle. when try:
./install_python_dependencies.sh install
it installs modules except one. module of cx-oracle. however, installed cx-oracle program on computer.
it prints error:
collecting cx-oracle==5.2 (from -r requirements/base.txt (line 82)) using cached cx_oracle-5.2.tar.gz complete output command python setup.py egg_info: traceback (most recent call last): file "<string>", line 1, in <module> file "/tmp/pip-build-rp7c9i/cx-oracle/setup.py", line 170, in <module> raise distutilssetuperror("cannot locate oracle software " \ distutils.errors.distutilssetuperror: cannot locate oracle software installation ---------------------------------------- command "python setup.py egg_info" failed error code 1 in /tmp/pip build-rp7c9i/cx-oracle/
how locate oracle software installation? ideas? please, help
for oracle 12.x , cx_oracle not available yet. need download instant client 11.x version.
go http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html , accept license agreement.
then download zip files names below
- instantclient-sdk-linux.x64-11.2.0.4.0.zip
- instantclient-basic-linux.x64-11.2.0.4.0.zip
and unzip them unzip command
unzip instantclient-sdk-linux.x64-11.2.0.4.0.zip unzip instantclient-basic-linux.x64-11.2.0.4.0.zip
both extracted common directory named "instantclient_11_2". add path below commands.
export oracle_home=/path-to_this/instantclient_11_2 cd $oracle_home ln -s libclntsh.so.11.1 libclntsh.so
open /etc/profile or .bashrc , following entries.
export oracle_home=/location/of/your/files/instantclient_11_2 export ld_library_path=$ld_library_path:$oracle_home
then source ~/.bashrc
or source /etc/profile
and install these packages
sudo apt-get install build-essential unzip python-dev libaio-dev
after use pip
or pip3
according python version , install
pip3 install cx_oracle
and try loading cx_oracle
module in python interpreter.
hope helps.
credit goes here: https://gist.github.com/kimus/10012910
note: have tried on ubuntu 16.04 installation , should work you.
Comments
Post a Comment