Q: cx_Oracle error ORA-24315 when connecting ... sometimes I wrote a script and ran it on desktop 'A' which targeted an Oracle db (10g) and an app server on desktop 'B'. It ran without any problems.
I then copied the script over to desktop 'B' and it spat out the following: 'ORA-24315: illegal attribute type' at the following snippet:
cx_dsn = cx_Oracle.makedsn(cx_hostname, cx_port, cx_SID)
cx_connection = cx_Oracle.Connection(cx_username + '/' + cx_password + '@'+ cx_dsn )

Both machines were configured as follows:


*

*Windows 7 (64-bit) 

*32-bit version of Python (ActiveState) 

*pypm install cx-oracle (Which resulted in version cx_Oracle.clientversion() = (11, 2, 0, 3, 0) - Yes this does indicate v11 but it worked against the 10g version from Desktop 'A')


Desktop 'B' however had Oracle 10g and WebSphere 7 installed - Desktop 'A' did not
I have searched and lots of people have encountered this problem or something similar but in general the only suggested solutions were:


*

*Ensure that the path doesn't reference Oracle libraries before the Python libraries - I guess the suggestion here is that the Oracle install on desktop B is inteferring. So I configured the path so that it only referenced Python (no mention of Oracle etc) - that didn't help

*Make sure you are using 32 bit version of everything or 64 bit version of everything - I did, 32 bit across the board as far as Python was concerned

*Ensure that the cx-Oracle matches the db you are targeting ... ok it looks like I have a problem but ... The strange thing is that the script does work on desktop 'A' so I imagine it must be something environmental on desktop 'B'. So off I go and install a dedicated 10g version of cx_Oracle. No success either.  (This query https://stackoverflow.com/questions/10456598/cx-oracle-multiple-instances-of-oracle-10-and-11-plus-oracle-home wasn't answered but sounds similar in nature)


So I am stuck - any suggestions?

A: We encountered the ORA-24315 error after installing a second Oracle client in a different version. In the PATH environment variable we simply changed the order of the Oracle paths entries.Probably cx_Oracle considers only the first appearance of Oracle in the PATH variable.
Our configuration:
Win 7, Oracle 11.2.0.3, cx_Oracle-5.1.1-11g.win32-py2.6
Change:
Additionally installed Oracle 10.2.0
Resulting Error message:
cx_Oracle.DatabaseError: ORA-24315: illegal attribute type
How we got it to work again:
changed PATHs order from 
path_to_Oracle10;path_to_Oracle11;...
to 
path_to_Oracle11;path_to_Oracle10;...

A: I was getting the error ORA-24315 no matter how I tried to connect.
Solution:
I originally downloaded/installed the Ora11g version, but the database is 10g. 
I installed the 10g version of cx_Oracle, and the connection worked the first time.
