[英]pymqi on macos Library not loaded: @rpath/libmqic_r.dylib
I'm trying to set up IBM MQ and pymqi on my macbook.我正在尝试在我的 macbook 上设置 IBM MQ 和 pymqi。 MQ is done via docker, no issues there.
MQ 是通过 docker 完成的,没有问题。 I've installed the IBM MQ from https://developer.ibm.com/messaging/2019/02/05/ibm-mq-macos-toolkit-for-developers/ and followed the instructions.
我已经从https://developer.ibm.com/messaging/2019/02/05/ibm-mq-macos-toolkit-for-developers/安装了 IBM MQ 并按照说明进行了操作。 I pip installed pymqi with no issues after that.
之后我 pip 安装了 pymqi 没有任何问题。
But when simply running import pymqi I get但是当简单地运行 import pymqi 我得到
ImportError: dlopen(/Users/.../Library/Python/2.7/lib/python/site-packages/pymqi/pymqe.so, 2): Library not loaded: @rpath/libmqic_r.dylib
I've been on this for a day now trying all manner of linking, copying, permissions of files, setting env vars etc. No suggestions seem to work despite it being quite a common issue (looking at google results at least).我已经在这一天尝试了各种方式的链接、复制、文件权限、设置 env vars 等。尽管这是一个非常普遍的问题(至少查看 google 结果),但似乎没有任何建议有效。
libmqic_r.dylib is available in two locations including /opt/mqm/lib64 libmqic_r.dylib 在两个位置可用,包括 /opt/mqm/lib64
otool output for this is below which I notice does not have LC_RPATH but I don't really understand it... i'm relatively new to python这个的 otool 输出低于我注意到没有 LC_RPATH 但我真的不明白它......我对 python 比较陌生
libmqic_r.dylib:
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
0xfeedfacf 16777223 3 0x00 6 14 928 0x00100085
Load command 0
cmd LC_SEGMENT_64
cmdsize 312
segname __TEXT
vmaddr 0x0000000000000000
vmsize 0x0000000000001000
fileoff 0
filesize 4096
maxprot 0x00000007
initprot 0x00000005
nsects 3
flags 0x0
Section
sectname __text
segname __TEXT
addr 0x00000000000006d0
size 0x000000000000088d
offset 1744
align 2^4 (16)
reloff 0
nreloc 0
flags 0x80000400
reserved1 0
reserved2 0
Section
sectname __cstring
segname __TEXT
addr 0x0000000000000f5d
size 0x000000000000004d
offset 3933
align 2^0 (1)
reloff 0
nreloc 0
flags 0x00000002
reserved1 0
reserved2 0
Section
sectname __unwind_info
segname __TEXT
addr 0x0000000000000fac
size 0x0000000000000048
offset 4012
align 2^2 (4)
reloff 0
nreloc 0
flags 0x00000000
reserved1 0
reserved2 0
Load command 1
cmd LC_SEGMENT_64
cmdsize 152
segname __DATA
vmaddr 0x0000000000001000
vmsize 0x0000000000001000
fileoff 4096
filesize 4096
maxprot 0x00000007
initprot 0x00000003
nsects 1
flags 0x0
Section
sectname __got
segname __DATA
addr 0x0000000000001000
size 0x0000000000000010
offset 4096
align 2^3 (8)
reloff 0
nreloc 0
flags 0x00000006
reserved1 0 (index into indirect symbol table)
reserved2 0
Load command 2
cmd LC_SEGMENT_64
cmdsize 72
segname __LINKEDIT
vmaddr 0x0000000000002000
vmsize 0x0000000000003000
fileoff 8192
filesize 8672
maxprot 0x00000007
initprot 0x00000001
nsects 0
flags 0x0
Load command 3
cmd LC_ID_DYLIB
cmdsize 48
name @rpath/libmqic_r.dylib (offset 24)
time stamp 1 Thu Jan 1 01:00:01 1970
current version 0.0.0
compatibility version 0.0.0
Load command 4
cmd LC_DYLD_INFO_ONLY
cmdsize 48
rebase_off 0
rebase_size 0
bind_off 8192
bind_size 40
weak_bind_off 0
weak_bind_size 0
lazy_bind_off 0
lazy_bind_size 0
export_off 8232
export_size 1008
Load command 5
cmd LC_SYMTAB
cmdsize 24
symoff 9312
nsyms 352
stroff 14952
strsize 1912
Load command 6
cmd LC_DYSYMTAB
cmdsize 80
ilocalsym 0
nlocalsym 281
iextdefsym 281
nextdefsym 68
iundefsym 349
nundefsym 3
tocoff 0
ntoc 0
modtaboff 0
nmodtab 0
extrefsymoff 0
nextrefsyms 0
indirectsymoff 14944
nindirectsyms 2
extreloff 0
nextrel 0
locreloff 0
nlocrel 0
Load command 7
cmd LC_UUID
cmdsize 24
uuid EDA21FCE-4BC7-39FC-A150-95D20DE313A6
Load command 8
cmd LC_VERSION_MIN_MACOSX
cmdsize 16
version 10.13
sdk 10.13
Load command 9
cmd LC_SOURCE_VERSION
cmdsize 16
version 0.0
Load command 10
cmd LC_LOAD_DYLIB
cmdsize 48
name @rpath/libmqe_r.dylib (offset 24)
time stamp 2 Thu Jan 1 01:00:02 1970
current version 0.0.0
compatibility version 0.0.0
Load command 11
cmd LC_LOAD_DYLIB
cmdsize 56
name /usr/lib/libSystem.B.dylib (offset 24)
time stamp 2 Thu Jan 1 01:00:02 1970
current version 1252.50.4
compatibility version 1.0.0
Load command 12
cmd LC_FUNCTION_STARTS
cmdsize 16
dataoff 9240
datasize 72
Load command 13
cmd LC_DATA_IN_CODE
cmdsize 16
dataoff 9312
datasize 0
IBM has released a set of dev patterns for MQ, and Python is included - https://github.com/ibm-messaging/mq-dev-patterns IBM 发布了一套 MQ 开发模式,其中包含 Python - https://github.com/ibm-messaging/mq-dev-patterns
My understanding is that most (I am guessing not the C#) have been tested on a mac, as they have mac set-up instructions - https://github.com/ibm-messaging/mq-dev-patterns/tree/master/Python我的理解是大多数(我猜不是 C#)已经在 mac 上测试过,因为它们有 mac 设置说明 - https://github.com/ibm-messaging/mq-dev-patterns/tree/master /Python
I suspect that you are missing -我怀疑你失踪了——
Add /IBM-MQ-Toolkit-Mac-x64-9.1.1.0/bin and /IBM-MQ-Toolkit-Mac-x64-9.1.1.0/samp/bin, to the PATH by editing /etc/paths
通过编辑 /etc/paths 将 /IBM-MQ-Toolkit-Mac-x64-9.1.1.0/bin 和 /IBM-MQ-Toolkit-Mac-x64-9.1.1.0/samp/bin 添加到 PATH
export DYLD_LIBRARY_PATH = /IBM-MQ-Toolkit-Mac-x64-9.1.1.0/lib64
导出 DYLD_LIBRARY_PATH = /IBM-MQ-Toolkit-Mac-x64-9.1.1.0/lib64
If this is the first time you have done any coding on your mac, you might be missing ac compiler.如果这是您第一次在 mac 上完成任何编码,您可能缺少 ac 编译器。 You will need to install Xcode.
您将需要安装 Xcode。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.