Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: cannot locate an Oracle software installation

I'm working on Plone.

PRELUDE

I've installed:

oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm oracle-instantclient12.1-devel-12.1.0.1.0-1.x86_64.rpm oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.x86_64.rpm

and also cx_Oracle. I've tested the installations and it's all ok: db connection successfully.

echo $ORACLE_HOME
/usr/lib/oracle/12.1/client64
echo $TNS_ADMIN
/usr/lib/oracle/12.1/client64/admin
echo $LD_LIBRARY_PATH
/usr/lib/oracle/12.1/client64/lib

THE PROBLEM

I've edited buildout.cfg as follows:

[...]
eggs =
    Plone
    Pillow
    collective.documentviewer
    Products.OpenXml
    Products.AROfficeTransforms
    tus
    wildcard.foldercontents==2.0a7
    **cx_Oracle**
[...]

I receive this error:

Unused options for buildout: 'environment-vars'.
Installing instance.
Getting distribution for 'cx-Oracle'.
error: cannot locate an Oracle software installation
An error occurred when trying to install cx-Oracle 5.1.3. Look above this message for any errors that were output by easy_install.
While:
  Installing instance.
  Getting distribution for 'cx-Oracle'.
Error: Couldn't install: cx-Oracle 5.1.3

I have no idea how to solve this.

"cannot locate an Oracle software installation" How to fix this?

like image 881
Massimo Variolo Avatar asked Dec 15 '22 21:12

Massimo Variolo


2 Answers

Got the same problem, background is:

echo $ORACLE_HOME
/usr/lib/oracle/12.1/client64

But: sudo env | grep ORACLE_HOME

yields nothing.

The solution:

sudo visudo

Then add the line :

Defaults env_keep += "ORACLE_HOME"

As found here

like image 149
ProfHase85 Avatar answered Dec 25 '22 13:12

ProfHase85


You must be sure that the right envvars are setted for the user that run the Plone instance.

The best way is to add those vars in the buildout configuration::

[buildout]
...

[instance]
...

environment-vars =
    ...
    LD_LIBRARY_PATH /usr/lib/oracle/10.2.0.3/client64/lib
    ORACLE_HOME /usr/lib/oracle/10.2.0.3/client64

(This is what I have on a CentOS installation)

like image 31
keul Avatar answered Dec 25 '22 12:12

keul