简体   繁体   English

CentOS 6.2上的cx_Oracle安装问题

[英]cx_Oracle install issue on CentOS 6.2

I feel bad posting yet another question on this, but all the others I've read through ended with a solution that doesn't necessarily apply or fix my issue. 我对此感到很难过,但又发布了另一个问题,但我阅读过的所有其他问题都以不一定适用或解决我的问题的解决方案结尾。

I have Oracle running on CentOS 6.2. 我在CentOS 6.2上运行了Oracle。 Database is up, sqlplus connects fine. 数据库启动,sqlplus连接正常。 I'm using Python 3.2 and Oracle 11.2.0.3 我正在使用Python 3.2和Oracle 11.2.0.3

I found and installed the package cx_Oracle-5.1.1-11g-py32-1.x86_64.rpm without error. 我找到并安装了软件包cx_Oracle-5.1.1-11g-py32-1.x86_64.rpm,没有错误。

[paws@linux ~]$ ls -al /usr/lib/python3.2/site-packages
total 360
drwxr-xr-x. 2 root root   4096 May  2 12:04 .
drwxr-xr-x. 3 root root   4096 Apr 13 09:31 ..
-rw-r--r--. 1 root root    898 Oct  8  2011 cx_Oracle-5.1.1-py3.2.egg-info
-rwxr-xr-x. 1 root root 353356 Oct  8  2011 cx_Oracle.cpython-32mu.so
[paws@linux ~]$ 

However when attempting to import cx_Oracle I still get an import error. 但是,当尝试导入cx_Oracle时,仍然出现导入错误。 I've checked the PYTHONPATH as shown below, and the appropriate directory is there: 我已经检查了PYTHONPATH,如下所示,并且存在适当的目录:

[paws@linux ~]$ python
Python 3.2.2 (default, Apr 13 2012, 09:15:56) 
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named cx_Oracle
>>> import sys
>>> print (sys.path)
['', '/home/paws', '/usr/lib/python3.2/site-packages', '/usr/local/lib/python32.zip', '/usr/bin/Python-3.2.2/Lib', '/usr/bin/Python-3.2.2/Lib/plat-linux2', '/usr/bin/Python-3.2.2/build/lib.linux-x86_64-3.2', '/usr/local/lib/python3.2/site-packages']

Is there anything else I can check to resolve this? 还有什么我可以检查解决的吗? I've installed cx_Oracle many times on Windows without issues, but this is the first time on linux, so I must be missing something simple. 我已经在Windows上多次安装cx_Oracle,没有任何问题,但这是第一次在linux上,因此我肯定缺少一些简单的东西。

Any help much appreciated. 任何帮助,不胜感激。

Just a thought. 只是一个想法。 I wonder if its an issue with your version tagged files . 我想知道它是否与您的版本标记文件有关

At the python prompt, what do you get when you enter: 在python提示符下,输入以下内容会得到什么:

>>>import sysconfig
>>>sysconfig.get_config_var('SO')

You should get: 'cpython-32mu.so' 您应该得到: 'cpython-32mu.so'

If not, you could try creating a symlink to point to this. 如果没有,您可以尝试创建一个符号链接来指向此链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM