我该如何解决这个无效的ELF头错误?

时间:2010-09-08 13:12:03

标签: linux

我在ubuntu 10.04上安装了zeromq,编译没有任何错误。

但是,当我尝试运行python测试时,会导致此错误:

jerome@VM1:~/zeromq/pyzmq-2.0.7$ python setup.py test
running test
Traceback (most recent call last):
  File "setup.py", line 144, in <module>
    'Topic :: System :: Networking'
  File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "setup.py", line 59, in run
    tests = TestLoader().loadTestsFromNames(testfiles)
  File "/usr/lib/python2.6/unittest.py", line 613, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python2.6/unittest.py", line 576, in loadTestsFromName
    module = __import__('.'.join(parts_copy))
  File "/home/jerome/zeromq/pyzmq-2.0.7/zmq/__init__.py", line 26, in <module>
    from zmq import _zmq
ImportError: /home/jerome/zeromq/pyzmq-2.0.7/zmq/_zmq.so: invalid ELF header

我需要做些什么来解决这个问题?

2 个答案:

答案 0 :(得分:0)

尝试像这样设置pyzmq:

python setup.py configure --zmq=<your_zmqlibrary_installation_path>
python setup.py build_ext --rpath=<your_zmqlibrary_installation_path>/lib --inplace
python setup.py install
python setup.py test

答案 1 :(得分:0)

根据how can i fix this invalid ELF header errror?,您需要在目标上编译 zeromq ,而不是使用MAC OS X版本......