简体   繁体   English

cx_oracle的安装失败

[英]installation of cx_oracle fails

I am trying to install cx_Oracle on my Mac Mavericks. 我正在尝试在Mac Mavericks上安装cx_Oracle。 Met with the following error. 遇到以下错误。 Any help, please. 请帮忙。

The sequence is: 顺序为:

sudo easy_install cx_Oracle
...
Processing cx_Oracle-5.1.2.tar.gz
Writing /tmp/easy_install-eFOU_a/cx_Oracle-5.1.2/setup.cfg
Running cx_Oracle-5.1.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-eFOU_a/cx_Oracle-5.1.2/egg-dist-tmp-g2eCKt
ld: file not found: crt3.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: Setup script exited with error: command '/usr/bin/clang' failed with exit status 1

I did not dig deeply but I found some workaround for this issue. 我没有深入研究,但是找到了解决此问题的方法。 I cloned repo from https://bitbucket.org/anthony_tuininga/cx_oracle and ran 我从https://bitbucket.org/anthony_tuininga/cx_oracle克隆了回购并运行

python setup.py build

Got an error: 出现错误:

/usr/bin/clang -bundle -undefined dynamic_lookup -L/usr/local/opt/readline/lib build/temp.macosx-10.4-x86_64-2.7-11g/cx_Oracle.o -L/opt/instantclient_11_2 -lclntsh -o build/lib.macosx-10.4-x86_64-2.7-11g/cx_Oracle.so -shared-libgcc
ld: file not found: crt3.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit status 1

After that I just copy & paste the command from output 之后,我只需复制并粘贴输出中的命令

/usr/bin/clang -bundle -undefined dynamic_lookup -L/usr/local/opt/readline/lib build/temp.macosx-10.4-x86_64-2.7-11g/cx_Oracle.o -L/opt/instantclient_11_2 -lclntsh -o build/lib.macosx-10.4-x86_64-2.7-11g/cx_Oracle.so -shared-libgcc

And ran 跑了

python setup.py install

SUDDENLY egg has been successfully installed. 突然,鸡蛋已成功安装。

Hope this helps. 希望这可以帮助。

  1. First download oracle mac client files from Oracle site, the two below 首先从Oracle站点下载oracle mac客户端文件,以下两个

Instant Client Package - Basic: All files required to run OCI, OCCI 即时客户端软件包-基本:运行OCI,OCCI所需的所有文件

Instant Client Package - SQL Plus: Additional libraries and executable for running SQL Plus with Instant Client Instant Client程序包-SQL Plus:用于通过Instant Client 运行SQL Plus的其他库和可执行文件

  1. Then unzip all and put in single folder. 然后全部解压缩并放入单个文件夹。 Now point that path to "LD LIBRARY PATH" for mac as two environment variable exports shown below 现在将该路径指向Mac的“ LD LIBRARY PATH”,作为如下所示的两个环境变量导出

export DYLD_LIBRARY_PATH=/Users/myUserName/Desktop/ORA_CLIENT/oracle_client export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: /Users/myUserName/Desktop/ORA_CLIENT/oracle_client 导出DYLD_LIBRARY_PATH = /用户/ myUserName /桌面/ ORA_CLIENT / oracle_client导出LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/ Users / myUserName / Desktop / ORA_CLIENT / oracle_client

  1. Now download cx_oracle source code tar ball, unzip it go to the source folder, run 现在下载cx_oracle源代码tar球,将其解压缩到源文件夹,运行

pip setup.py install pip setup.py安装

  1. Will get the below error 将得到以下错误

ld: file not found: crt3.o ld:找不到文件:crt3.o

  1. Now copy the gcc bundle command just above the command line run output (sample pasted below) 现在,将gcc bundle命令复制到命令行运行输出的正上方(下面粘贴的示例)

gcc -bundle -undefined dynamic_lookup build/temp.macosx-10.4-x86_64-2.7-11g/cx_Oracle.o -L/Users/myUserName/Desktop/ORA_CLIENT/oracle_client -lclntsh -o build/lib.macosx-10.4-x86_64-2.7-11g/cx_Oracle.so -shared-libgcc gcc-捆绑-未定义dynamic_lookup build / temp.macosx-10.4-x86_64-2.7-11g / cx_Oracle.o -L / Users / myUserName / Desktop / ORA_CLIENT / oracle_client -lclntsh -o build / lib.macosx-10.4-x86_64-2.7 -11g / cx_Oracle.so -shared-libgcc

  1. Paste it in command line, hit enter. 将其粘贴在命令行中,然后按Enter。 It will go thru. 它会通过。 Now run “python setup.py install”. 现在运行“ python setup.py install”。 It will be done 将会完成

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

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