.so文件的elf标头错误无效

时间:2014-12-22 16:00:46

标签: python linux import

我正在尝试在python中运行脚本,并且我收到“无效的elf标头”错误。我有一系列相互调用的脚本,我会继续并包括那些:

import sys
sys.path.append("/home/smh/Linux/Desktop/gras-03-03/python")
from python_utilities import GRASTestor

调用GRASTestor.py

from BaseTestor import BaseTestor
import numpy as np
import hepunit as unit
from gdml_writer import gdml_writer 
from GDMLGeometryBuilder import GDMLGeometryBuilder
from GRASMacroBuilder import GRASMacroBuilder,GRASRMCMacroBuilder
from Plotters import Plotter
import os
import sys
import SpenvisCSVFileHandler

调用SpenvisCSVFileHandler.py

import  string
import Spenvis.so
import os
from numpy import *

这是我们得到错误的地方,特别是“import Spenvis.so”行

/home/smh/Linux/Desktop/gras-03-03/python/python_utilities
Traceback (most recent call last):
  File "perform_gras_rmc_tests.py", line 6, in <module>
    from python_utilities import GRASTestor
  File "/home/smh/Linux/Desktop/gras-03-03/python/python_utilities/GRASTestor.py", line 19, in <module>
    import SpenvisCSVFileHandler
  File "/home/smh/Linux/Desktop/gras-03-03/python/python_utilities/SpenvisCSVFileHandler.py", line 8, in <module>
    import Spenvis.so
ImportError: /home/smh/Linux/Desktop/gras-03-03/python/python_utilities/Spenvis.so: invalid ELF header

而且我不确定为什么它不起作用。任何建议将不胜感激!

1 个答案:

答案 0 :(得分:2)

没关系。在查看文件体系结构时,由于某种原因,文件Spenvis.so似乎是特定于mac的。那么只需要获取正确的文件。