oracle / python-cx_Oracle

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

Failed to install 7.2.0-dev due "FileNotFoundError: [Errno 2] No such file or directory: 'odpi/src'" #302

Closed rafaelreuber closed 5 years ago

rafaelreuber commented 5 years ago

I tried to install the current version on master and got the following error:

Steps to reproduce the issue:

  1. Download the master version (python-cx_Oracle-master.zip)
  2. Create a new virtualenv
  3. Activate the new virtualenv
  4. Install the cx_Oracle pip install python-cx_Oracle-master.zip
pip install python-cx_Oracle-master.zip 
Processing ./python-cx_Oracle-master.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-jzc4e9sg/setup.py", line 91, in <module>
        for n in sorted(os.listdir(dpiSourceDir)) if n.endswith(".c")]
    FileNotFoundError: [Errno 2] No such file or directory: 'odpi/src'

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-jzc4e9sg/
  1. What is your version of Python? Is it 32-bit or 64-bit? 64 bits

  2. What is your cx_Oracle version? 7.2.0-dev

  3. What exact command caused the problem (e.g. what command did you try to install with)? Who were you logged in as? pip install python-cx_Oracle-master.zip

  4. What error(s) you are seeing? FileNotFoundError: [Errno 2] No such file or directory: 'odpi/src'

  5. What OS (and version) is Python executing on? Fedora 29 (64Bits)

  6. What is your version of the Oracle client (e.g. Instant Client)? How was it installed? Where is it installed? The version used is 12.2.0.1.0. I installed using rpm files. Is installed on /usr/lib/oracle/12.2

  7. What is your Oracle Database version? XE

  8. What is the PATH environment variable (on Windows) or LD_LIBRARY_PATH (on Linux) set to? On macOS, what is in ~/lib? LD_LIBRARY_PATH: /usr/lib/oracle/12.2/client64/lib

anthony-tuininga commented 5 years ago

If you're downloading a zip file from GitHub this issue is expected. GitHub does not include the contents of submodules (which is what ODPI-C is to cx_Oracle). You have to download that yourself separately. I don't believe there is anything I can do about that!

rafaelreuber commented 5 years ago

Yes, I downloaded the zip from the Github.

rafaelreuber commented 5 years ago

I found the instructions to install using github sources: https://cx-oracle.readthedocs.io/en/latest/installation.html#install-using-github

anthony-tuininga commented 5 years ago

You would need to do the following steps (after your virtual env is activated):

wget https://github.com/oracle/python-cx_Oracle/archive/master.zip
unzip master.zip
cd python-cx_Oracle-master
wget https://github.com/oracle/odpi/archive/master.zip
unzip master.zip
rm -rf odpi
mv -i odpi-master odpi
python setup.py install
anthony-tuininga commented 5 years ago

If you are able to use the instructions you referenced and clone from GitHub the task is a bit easier. :-)

rafaelreuber commented 5 years ago

It worked. Thank you!

anthony-tuininga commented 5 years ago

You're welcome! Glad to be of help. :-)

naveenkumar2103 commented 4 years ago

error: cx_Oracle.DatabaseError: ORA-12541: TNS:no listener I got this after doing this steps 💯 wget https://github.com/oracle/python-cx_Oracle/archive/master.zip unzip master.zip cd python-cx_Oracle-master wget https://github.com/oracle/odpi/archive/master.zip unzip master.zip rm -rf odpi mv -i odpi-master odpi python setup.py install

what can I do to for that problem

anthony-tuininga commented 4 years ago

You need to check your connect string as the error indicates that there is no listener listening at the location you are telling it to look! Also, please create a separate issue instead of tacking your question on to an old existing one. Thanks.