简体   繁体   English

python import cx_Oracle错误

[英]python import cx_Oracle error

I'm trying to install cx_Oracle to use Django inspectdb on an existing Oracle database to create models.py automatically. 我正在尝试安装cx_Oracle,以在现有Oracle数据库上使用Django inspectdb来自动创建models.py。 So far i'ts been very hard. 到目前为止,我还很努力。 I'm running a VM with Fedora 14 64bit and Python 2.7 and followed a mix of pages found with google to get it installed with sudo -E easy_install cx_Oracle 我正在使用Fedora 14 64位和Python 2.7运行VM,然后通过google找到的混合页面使用sudo -E easy_install cx_Oracle进行安装

When I fire up python from terminal and try to import cx_Oracle to test the installation I get this: 当我从终端启动python并尝试导入cx_Oracle以测试安装时,我得到以下信息:

>>> import cx_Oracle
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libclntsh.so.11.1: cannot enable executable stack as shared object requires: Permission denied

I've never seen this before and don't know what to do. 我以前从未见过,也不知道该怎么办。 Any help would be very much appreciated. 任何帮助将不胜感激。 Thanks in advance, 提前致谢,

Stefano 斯特凡诺

It was SELinux, Fedora security system that was blocking it and I didn't notice! 是SELinux,Fedora安全系统阻止了它,我没有注意到! Installation was ok and it's working now. 安装还可以,现在可以正常工作。 Sorry and thanks everyone. 对不起,谢谢大家。

It has occurred for me long time back 很久以前就发生了

There are two set of libraries for 32 bit and 64 bit just copy these "*.so" files to the appropriate directories. 只需将这些“ * .so”文件复制到适当的目录,就可以使用两组用于32位和64位的库。

Please note there are more than 1 file[around 5 i guess] to be copied . 请注意,要复制的文件不止1个(大约5个)。 just use a find command to locate your present location of libclntsh.so file and copy it to the respective lib directories. 只需使用find命令找到libclntsh.so文件的当前位置并将其复制到相应的lib目录即可。 you can find the rest of the files since same exception pops up for everything. 您可以找到其余文件,因为所有内容都会弹出相同的异常。

You forgot to add the instantclient path in ldconfig; 您忘记在ldconfig中添加即时客户端路径; adding it will fix this problem. 添加它可以解决此问题。

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

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