MAC El Capitan以上版本安装cx_Oracle
来源:互联网 发布:太阳队布克数据 编辑:程序博客网 时间:2024/05/22 02:27
其实安装的步骤是非常简单的,按照其他博客的安装:
http://thelaziestprogrammer.com/sharrington/databases/oracle/install-cx_oracle-mac
你可以很快的完成。但我的版本是MacOs Sierra,无论怎么安装死活都是:
Traceback (most recent call last): File "<string>", line 1, in <module>ImportError: dlopen(/Library/Python/2.7/site-packages/cx_Oracle.so, 2): Library not loaded: @rpath/libclntsh.dylib.12.1 Referenced from: /Library/Python/2.7/site-packages/cx_Oracle.so Reason: image not found
怎么解决这个问题?
首先,cx_Oracle.so是一个库,会动态连接很多文件,libclntsh.dylib.12.1就是其中一个,我们可以使用otool命令, -L和-l参数查看该文件的dependency:
otool -L /Library/Python/2.7/site-packages/cx_Oracle.so/Library/Python/2.7/site-packages/cx_Oracle.so: @rpath/libclntsh.dylib.12.1 (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)otool -l /Library/Python/2.7/site-packages/cx_Oracle.so/Library/Python/2.7/site-packages/cx_Oracle.so:Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags 0xfeedfacf 16777223 3 0x00 8 14 1416 0x00000085...Load command 9 cmd LC_LOAD_DYLIB cmdsize 56 name @rpath/libclntsh.dylib.12.1 (offset 24) time stamp 2 Thu Jan 1 08:00:02 1970 current version 0.0.0compatibility version 0.0.0Load command 10 cmd LC_LOAD_DYLIB cmdsize 56 name /usr/lib/libSystem.B.dylib (offset 24) time stamp 2 Thu Jan 1 08:00:02 1970 current version 1238.60.2compatibility version 1.0.0Load command 11 cmd LC_FUNCTION_STARTS cmdsize 16 dataoff 132856 datasize 424Load command 12 cmd LC_DATA_IN_CODE cmdsize 16 dataoff 133280 datasize 32
从otool -l的命令输出里面,我们没有找到类似的打印:
Load command 13 cmd LC_RPATH cmdsize 48 path /usr/local/opt/instantclient_12_1/ (offset 12)
这表示@rpath对应的LC_RPATH没有在编译cx_Oracle.so的时候加入到包中,那么我们就手动加:
install_name_tool -add_rpath /usr/local/opt/instantclient_12_1/ /Library/Python/2.7/site-packages/cx_Oracle.so
阅读全文
0 0
- MAC El Capitan以上版本安装cx_Oracle
- Mac 10.11 El Capitan 安装caffe 注意事项
- 如何安装 mac El Capitan 系统
- Mac OS X El Capitan 全新安装记录
- 基于VM10+Win7安装Mac OSX10.11 El Capitan
- 基于VM10+Win7安装Mac OSX10.11 El Capitan
- Mac OS X El Capitan 下安装 Scrapy
- 在 Mac OS X El Capitan 安装 IPython 和 XtraFinder
- MacOS El Capitan 安装Latex
- Mac 安装cx_Oracle
- 安装Mac版cx_Oracle
- mac El Capitan+ brew update error 无法访问
- 苹果最新 Mac OS X El Capitan 正式版系统 dmg 镜像下载 / 升级安装程序
- 在Mac OS El Capitan下用pip安装Scrapy 失败
- Mac OSX El Capitan 10.11 安装nginx(http2) php7.0 mysql5.7 开发环境
- mac电脑安装 python3.0以上版本
- OS X El Capitan U盘安装
- Mac OS X EL Capitan MAC OX 10.11 安装cocoapods后还是提示-bash :pod command not found 解决办法
- AFNetworking 3.0 源码解读(五)之 AFURLSessionManager
- python基础(二)
- scala中的trait
- SQL 约束 (Constraints)
- iOS远程真机之WebDriverAgent 天坑记
- MAC El Capitan以上版本安装cx_Oracle
- Ext.Ajax.request 中success failure
- 轻量级motan RPC+consul注册服务实现详细DEMO
- 读书笔记:《特劳特营销十要》
- 1YDB后台计划任务无法生成的解决方法
- Android Fingerprint完全解析(二) :Fingerprint启动流程
- AFNetworking 3.0 源码解读(六)之 AFHTTPSessionManager
- 热的不止《我的前半生》还有持续的高温天气和...
- 吐槽一品威客的退款服务