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

Django oracle its not working #129

Closed huseyinbilgili closed 6 years ago

huseyinbilgili commented 6 years ago
  1. What is your version of Python? Is it 32-bit or 64-bit? python 3.6.3 | 64 bit

  2. What is your version of cx_Oracle? latest

  3. What is your version of the Oracle client (e.g. Instant Client)? How was it installed? Where is it installed? oracle client 12.2.0 its installed C:\oracle\client

  4. What is your version of the Oracle Database?

  5. What is your OS and version? Windows 10

  6. What compiler version did you use? For example, with GCC, run gcc --version.

  7. What environment variables did you set? How exactly did you set them?

  8. What exact command caused the problem (e.g. what command did you try to install with)? Who were you logged in as?

  9. What error(s) you are seeing?

    Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/django/utils/autoreload.py", line 228, in wrapper
     fn(*args, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 128, in inner_run
     self.check_migrations()
    File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 422, in check_migrations
     executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
    File "/usr/local/lib/python3.6/site-packages/django/db/migrations/executor.py", line 20, in __init__
     self.loader = MigrationLoader(self.connection)
    File "/usr/local/lib/python3.6/site-packages/django/db/migrations/loader.py", line 52, in __init__
     self.build_graph()
    File "/usr/local/lib/python3.6/site-packages/django/db/migrations/loader.py", line 209, in build_graph
     self.applied_migrations = recorder.applied_migrations()
    File "/usr/local/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 65, in applied_migrations
     self.ensure_schema()
    File "/usr/local/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 52, in ensure_schema
     if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
    File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 254, in cursor
     return self._cursor()
    File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 229, in _cursor
     self.ensure_connection()
    File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 213, in ensure_connection
     self.connect()
    File "/usr/local/lib/python3.6/site-packages/django/db/utils.py", line 94, in __exit__
     six.reraise(dj_exc_type, dj_exc_value, traceback)
    File "/usr/local/lib/python3.6/site-packages/django/utils/six.py", line 685, in reraise
     raise value.with_traceback(tb)
    File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 213, in ensure_connection
     self.connect()
    File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 189, in connect
     self.connection = self.get_new_connection(conn_params)
    File "/usr/local/lib/python3.6/site-packages/django/db/backends/oracle/base.py", line 212, in get_new_connection
     return Database.connect(self._connect_string(), **conn_params)
    django.db.utils.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help

    I'm using docker and when i did docker-compose up that traceback seeing. Whats the error exactly and what should i do

anthony-tuininga commented 6 years ago

Can you double check a few things? You specify a Windows path for your instant client....but your traceback is on Linux! You need to have an Oracle Client library installed on the platform on which you are using cx_Oracle. See the web page referenced in the error message for additional information.

huseyinbilgili commented 6 years ago

thanks for your response it was my fault. Its all about oracle client library i installed that and its fixed also i install libclntsh.so in my docker file and its all fixed.