本文介绍了python swig:ImportError错误的ELF类:ELFCLASS64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试通过swig从python到c ++代码进行接口.尝试执行脚本时出现以下错误.
I am trying to interface from python to c++ code via swig.I get the following error , while trying to execute my script.
File "./driver.py", line 4, in <module>
from fixMessageSim import *
File "/var/user/pradyotd/testframework/fixMessageSim.py", line 12, in <module>
import MessageFactory
File "/var/user/pradyotd/testframework/MessageFactory.py", line 25, in <module>
_MessageFactory = swig_import_helper()
File "/var/user/pradyotd/testframework/MessageFactory.py", line 21, in swig_import_helper
_mod = imp.load_module('_MessageFactory', fp, pathname, description)
ImportError: /var/user/pradyotd/testframework/_MessageFactory.so: wrong ELF class: ELFCLASS64`
当我在.so上运行文件时,我得到
when I run file on the .so I get
_MessageFactory.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, not stripped
与python类似
/usr/bin/python: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
所以我不清楚为什么64位.so会抱怨.
So I am not clear why a 64-bit .so would complain.
谢谢
推荐答案
看来,我以为我使用的解释器不是文件中的那个.这似乎不是问题.
It would appear, that the interpreter I thought I was using , was not the one in the file.This appears to be a non-issue.
这篇关于python swig:ImportError错误的ELF类:ELFCLASS64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!