I am facing a problem while installing cx_Oracle module.
I have installed Oracle Sql developer using which I can connect to any Oracle Server. I have also installed cx_oracle module. Now when I try to import the module I am reciving below mentioned error.
import cx_Oracle
Traceback (most recent call last):
File "", line 1, in
import cx_Oracle
ImportError: DLL load failed: The specified module could not be found.
After googling I can find that they want me to install Oracle client, but since I already have Oracle Sql developer which can act as a oracle client, I am unable to find the difference between two. Can someone please help me out.
You will need C-language based Oracle "client" libraries installed on your local machine. (SQL Developer uses Java libraries). To connect to a remote database you can install the Oracle Instant Client.
I have explained installation steps here for 32 bit OS and here for 64 bit OS.
BTW, you have to add your oracle_instant_client path to your PATH environment variable. The error you've got is because the OS did not load required DLL files for oracle.
Related
I'm building a django application using Pyinstaller.
When I run the application i get an error from dapne server.
"daphne\server.py:13: UserWarning: Something has already installed a non-asyncio Twisted reactor. Attempting to uninstall it; you can fix this warning by importing daphne.server early in your codebase or finding the package that imports Twisted and importing it later on."
In addition, when I compare the console log of the EXE application and a regular run of the django application I notice the following difference.
In the regular run which works as expected I see the following print:
"Django version 2.1.5, using settings 'cfehome.settings'
Starting ASGI/Channels version 2.1.5 development server at http://0.0.0.0:8000/"
however, when I run the application from the EXE I see:
"Django version 2.1.5, using settings 'cfehome.settings'
Starting development server at http://0.0.0.0:8000/"
Appreciate any lead to understand this behavior and ways to fix it.
I know this is old but for others seeking answer. There's a simple fix:
Before importing raven in settings.py, import daphne.server So, your settings.py will look like this:
import daphne.server
import raven
For further information you can read: https://github.com/django/channels/issues/793
I hope it will help.
I am trying to use oracle 12c as database for my application using Django framework. But I am struck in version related issue
Following are the version of library used:
Python 3.6
cx_Oracle 6
Oracle instant client 12.2
Oracle 12 C database on server
Oracle 10 g on local machine where the cx_oracle
is installed
OS is windows 7
Following are the steps which I did to install cx_oracle
pip install cx_Oracle
Download Oracle instant client 12.2 zip file for windows
Extracted the zip file
Added the above unzipped folder to user PATH variable
From CMD I try to execute
python
import cx_Oracle
con = cx_Oracle.connect(uname, pwd, server_ip:port/name)
I am getting the error:
cx_oracle.databaseerror: dpi-1050: oracle client library must be at version 11.2 or higher
Is cx_Oracle having any conflict with oracle 10 g installed at local machine
I cannot upgrade the local oracle 10g db because(no rights given)
How do I resolved the above issue.
How can I make sure cx_Oracle uses the correct Oracle instant client( i.e, 12.2) to connect to server db.
Make sure that the directory containing the instant client is earlier in the PATH environment variable than your 10g installation. That should resolve it for you.
you use set ORACLE_HOME too:
SET ORACLE_HOME=C:\Oracle\client_12_1
SET PATH=C:\Oracle\client_12_1\bin;%PATH%
python
import cx_Oracle
con = cx_Oracle.connect(uname, pwd, server_ip:port/name)
The error is in gspread authentication. Got
oauth2client.client.CryptoUnavailableError: No crypto library available
I have installed both pyOpenSSL and pycrypto. With the Crypto folder obtained after installation of pycrypto in my app directory.
I dug deeper on why the above error still persists. I found
from oauth2client import crypt
to be the cause. The following ImportError is being raised.
ImportError: No encryption library found. Please install either PyOpenSSL, or PyCrypto 2.6 or later
Please help. I earlier(few months ago) got it working by adding the following in my app.yaml. But this time it is not working.
libraries:
- name: pycrypto
version: "latest"
- name: ssl
version: latest
I use mac for development in case you need this to help me out. The thing is gspread used properly work using oauth2client. Today i tried to install google cloud storage client. I might have done something unknowningly during the installation process. After which the gspread authentication keeps failing. I have no clue on what to do next.
But note that the gspread authentication works flawlessly on production. I verified by pulling the production code.
I was able to fix this issue by reinstalling pyOpenSSL, cryptography.
But now i got another error.
ImportError: No module named cryptography.hazmat.bindings._openssl
ImportError: No module named cryptography.hazmat.bindings._openssl
I have developed a Django application, and i am
trying to get it to run under IIS on Windows Server 2003. I'm
generally following the Django walkthrough but my db is Oracle.
If I run python from the command prompt and import cx_Oracle, it works
just fine. If I run the project with django's development server, everything works fine too.
I haven't managed to get it rum on IIS6 but when a test.py is loaded by IIS and
PyISAPIe, it says it cannot load cx_Oracle and displays the following
error:
Error loading cx_Oracle module: DLL load failed: The specified module
could not be found.
I'm using the 32-bit versions of the following:
Python 2.6.6,
PyISAPIe 1.1.0 rc4 py2.6,
Django 1.4.3,
Oracle Client 11.2,
cx_Oracle 5.1 (for Oracle 11g, Python 2.6)
Any thoughts on why this might be happening?
EDIT:I tried downgrading to cx_Oracle 4.4.1 and now I get the error:
ImportError: cannot import name utils
I am a newbie to Python trying out to quickly build a site using Django.
Following are the steps I have performed (Win 7):
Installed Python 2.7
Installed Django 1.4
Created a project and app
Started the server using 'python manage.py startserver' and accessed using the "http://127.0.0.1:8000" the basic page.
Now wanted to configure my Oracle 11g DB for my project. Hence, installed cx_Oracle 5.1-11g and tried 'python manage.py syncdb' which failed with cx_Oracle.DatabaseError: ORA-24315: illegal attribute type.
Got the same error even from a python interpretor.
import cx_Oracle
connection=cx_Oracle.Connection('python_user','python_user','(DESC..string..)')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cx_Oracle.DatabaseError: ORA-24315: illegal attribute type
I am using the correct credentials and libraries as per my trouble shooting.
Any help is appreciated..
Checking which attribute is failing by raising an explicit exception might help you in the right direction
try:
connection=cx_Oracle.Connection('python_user','python_user','(DESC..string..)')
except cx_Oracle.DatabaseError, e:
print e[0].context
raise
The main problem is versions of the following should be compatible with each other.
Python 2.7, Django 1.4, Oracle DB 11g (which I connect to) and lib cx_Oracle 5.0.3+-11g should be in compatible with Oracle Xe 11.2 (which was 10.2 previously).
After installing the right version and setting the ORACLE_HOME to 'C:/oraclexe/.../11.2.0/server' it started connecting without any issues.