2015-12-02 107 views
1

我剛剛創建了一個虛擬機流浪漢在CentOS,安裝python2.7和使用Miniconda點子,使用PIP安裝pymqi,創建了一個測試Python文件看如果我的pymqi安裝是否正確:libmqic_r.so:無法打開共享對象文件:沒有這樣的文件或目錄,蟒蛇

import pymqi 
print "hello..." 

,但我得到這個:

[[email protected] projects]$ python test.py 
Traceback (most recent call last): 
File "test.py", line 1, in <module> 
import pymqi 
File "/home/vagrant/miniconda2/lib/python2.7/site-packages/pymqi/__init__.py", line 109, in <module> 
import pymqe, CMQC, CMQCFC, CMQXC 
ImportError: libmqic_r.so: cannot open shared object file: No such file or directory 

我看了這個文件:

[[email protected] projects]$ find /opt/mqm/ -name 'libmqic_r.so' 
/opt/mqm/lib/compat/libmqic_r.so 
/opt/mqm/lib/libmqic_r.so 
/opt/mqm/lib64/compat/libmqic_r.so 
/opt/mqm/lib64/libmqic_r.so 

謝謝,你的幫助表示感謝。

回答

1

我找到了解決辦法:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/mqm/lib64 
0

作爲一般規則,使用LD_LIBRARY_PATH變量是一個不好的做法。你最好創建適當的符號鏈接到64位版本的共享對象。

對於FOME原因,當您安裝IBM MQSeries客戶,只有32位MQ庫鏈接到/ usr/lib中/:

[[email protected] ~]# ll /usr/lib/libmq* 
lrwxrwxrwx 1 root root 26 Jan 25 12:49 /usr/lib/libmqicb_r.so -> /opt/mqm/lib/libmqicb_r.so 
lrwxrwxrwx 1 root root 24 Jan 25 12:49 /usr/lib/libmqicb.so -> /opt/mqm/lib/libmqicb.so 
lrwxrwxrwx 1 root root 25 Jan 25 12:49 /usr/lib/libmqic_r.so -> /opt/mqm/lib/libmqic_r.so 
lrwxrwxrwx 1 root root 23 Jan 25 12:49 /usr/lib/libmqic.so -> /opt/mqm/lib/libmqic.so 
lrwxrwxrwx 1 root root 25 Jan 25 12:49 /usr/lib/libmqiz_r.so -> /opt/mqm/lib/libmqiz_r.so 
lrwxrwxrwx 1 root root 23 Jan 25 12:49 /usr/lib/libmqiz.so -> /opt/mqm/lib/libmqiz.so 
lrwxrwxrwx 1 root root 25 Jan 25 12:49 /usr/lib/libmqjx_r.so -> /opt/mqm/lib/libmqjx_r.so 
lrwxrwxrwx 1 root root 26 Jan 25 12:49 /usr/lib/libmqmcs_r.so -> /opt/mqm/lib/libmqmcs_r.so 
lrwxrwxrwx 1 root root 24 Jan 25 12:49 /usr/lib/libmqmcs.so -> /opt/mqm/lib/libmqmcs.so 
lrwxrwxrwx 1 root root 25 Jan 25 12:49 /usr/lib/libmqmzse.so -> /opt/mqm/lib/libmqmzse.so 

雖然64位的庫都沒有:

[[email protected] ~]# ll /usr/lib64/libmq* 
ls: /usr/lib64/libmq*: No such file or directory 

你可以通過執行即可修復

[[email protected] ~]# ln -s /opt/mqm/lib64/libmq* /usr/lib64/ 
相關問題