Error loading cx_Oracle module with IIS and PyISAPIe - django

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

Related

Getting error when changing sqlite3 to mysql in windows 2012 server iis

i am trying hosting django application to windows server 2012 iis, everything working fine with sqlite3, but when i changed my database to mysql i am getting error.
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb.
I changed database settings in django to mysql.
Thanks
Sounds like you don't have MySQL module installed in the environment.
Just run > pip install mysql-python and try again.

cx_oracle 6 for Oracle 12C version error

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)

python can load GDAL, but django can't

I was able to successfully install gdal 1.11 and load it from python shell on my windows 32 bit machine. I can also verify its success by typing "gdalinfo --version" and getting the correct version info: GDAL 1.11.4, released 2016/01/25
However, when running "python manage.py shell" in django 1.11, I got error 127 'the specified procedure could not be found'. The error occurred when django called function lgdal = CDLL(lib_path)
I printed out lib_path, it is correct. The same function worked fine in my python shell.
Any idea why loading gdal111.dll would fail in the django environment when it has no problem in the python shell? Thanks.

Error while importing cx_Oracle on windows

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.

Python's Django could not connect to Oracle 11g

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.