Thread: [cx-oracle-users] This must be something simple....
Brought to you by:
atuining
From: Dwayne K. <dw...@kr...> - 2012-09-10 15:35:12
|
OK, I KNOW I'm missing something simple here. Please point out the simple thing that I'm missing. I've been setting up a system and I have Oracle installed and running, and upgraded Python to 3.2 However whenever I try to install and use cx_Oracle it can't seem to find the package. At first I thought it might have been something related to my distrib (CentOS) so I changed to RHEL and I get exactly the same thing! So as you can see from the output below, the install of cx_Oracle was uneventful: [root@dblinux uploads]# rpm -Uvh cx_Oracle-5.1.1-11g-py32-1.x86_64.rpm Preparing... ########################################### [100%] 1:cx_Oracle ########################################### [100%] [root@dblinux /]# find . -name cx_* ./uploads/cx_Oracle-5.1.1-11g-py32-1.x86_64.rpm ./usr/share/doc/cx_Oracle-5.1.1 ./usr/lib/python3.2/site-packages/cx_Oracle.cpython-32mu.so ./usr/lib/python3.2/site-packages/cx_Oracle-5.1.1-py3.2.egg-info Oracle is installed and running: [oracle@dblinux ~]$ sqlplus system/config SQL*Plus: Release 11.2.0.1.0 Production on Thu Sep 6 16:42:42 2012 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> You can see that I have my environment set up so that PYTHONPATH includes the folder where the cx_Oracle files were found. Also verified by printing sys.path: CODE: SELECT ALL<http://www.python-forum.org/pythonforum/viewtopic.php?f=16&t=36468#> [oracle@dblinux ~]$ env|grep PYTH PYTHONPATH=/usr/local/lib/python32.zip:/opt/Python-3.2.3/Lib:/opt/Python-3.2.3/Lib/plat-linux2:/opt/Python-3.2.3/build/lib.linux-x86_64-3.2:/usr/local/lib/python3.2/site-packages:/usr/lib/python3.2/site-packages [oracle@dblinux ~]$ python Python 3.2.3 (default, Sep 6 2012, 16:12:29) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> print (sys.path) ['', '/usr/local/lib/python32.zip', '/opt/Python-3.2.3/Lib', '/opt/Python-3.2.3/Lib/plat-linux2', '/opt/Python-3.2.3/build/lib.linux-x86_64-3.2', '/usr/local/lib/python3.2/site-packages', '/usr/lib/python3.2/site-packages', '/opt/python/Lib', '/opt/python/Lib/plat-linux2', '/opt/python/build/lib.linux-x86_64-3.2'] >>> import cx_Oracle Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named cx_Oracle Yet, for some reason it STILL can't see cx_Oracle. This is the first non-windoze box I've set cx_Oracle up on, so I'm not sure if there is something platform specific that I'm missing. I will be extremely grateful if someone can point what I'm missing. Dwayne |
From: Mark H. <mh...@pi...> - 2012-09-10 17:54:18
|
On 9/10/12 8:05 AM, Dwayne King wrote: > I will be extremely grateful if someone can point what I'm missing. I don't have any specific suggestions, but I've always found strace to be helpful in diagnosing library problems. echo import cx_Oracle >foo.py strace python foo.py You can look in the output for the files you installed and see if they're being found, or if there's any other oddness in loading them. HTH! |
From: Dwayne K. <dw...@kr...> - 2012-09-10 18:28:32
|
Mark, Thanks for the hint - this may have proved useful. When I do what you suggest and use strace to follow what's going on, I noticed two things: 1) the installation of the cx_Oracle rpm seems to have dropped (only?) two files in /usr/lib/python3.2/site-packages: cx_Oracle.cpython-32mu.so and cx_Oracle-5.1.2-py3.2.egg-info Note that these are in the site-packages folder itself - not a subfolder 2) the output of strace shows that it looks for a slightly different name: cx_Oracle.cpython-32m.so (not the absence of the "u") So....a few followup questions: 1) should there be more files there? Or is it really just the .so? The strace seems to show that it also looks for: - cx_Oracle - cx_Oraclemodule.cpython-32m.so - cx_Oracle.abi3.so - cx_Oraclemodule.abi3.so - cx_Oracle.so - cx_Oraclemodule.so - cx_Oracle.py - cx_Oracle.pyc 2) Should I be able to create a symlink to resolve at least the one with a slightly different name? I'm at a bit of a loss simply because I don't have a working cx_Oracle on a linux box anywhere to compare to. Thanks again - your time is greatly appreciated. Dwayne On Mon, Sep 10, 2012 at 1:20 PM, Mark Harrison <mh...@pi...> wrote: > On 9/10/12 8:05 AM, Dwayne King wrote: > > I will be extremely grateful if someone can point what I'm missing. > > I don't have any specific suggestions, but I've always found strace to be > helpful in diagnosing library problems. > > echo import cx_Oracle >foo.py > strace python foo.py > > You can look in the output for the files you installed and see if they're > being found, or if there's any other oddness in loading them. > > HTH! > > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |