17

I'm getting an IMPORT ERROR with the following error message in Django debug mode /usr/local/lib/python2.6/dist-packages/lxml-2.3-py2.6-win32.egg/lxml/objectify.pyd: invalid ELF header

What does this mean and how do I fix it? Google is revealing not very much at the moment. This error is coming from this package I am using in my Django app

Update I'm using ubuntu and Python2.6

2
  • 4
    You are trying to import a win32-compiled "egg" on Linux. Commented Apr 19, 2011 at 8:43
  • Please, add what platform are you on and what version of python you use. Commented Apr 19, 2011 at 8:45

3 Answers 3

16

The error means the objectify.pyd is not a valid shared library. You seem to have lxml compiled for different version of python from what you are running.

Guessing from the path, the fact that 'ELF' is an object (shared and executable) format used on unices and the package has -win32 in it's name you are probably trying to use windows build on linux.

Sign up to request clarification or add additional context in comments.

5 Comments

That's quite odd isn't it. So how can I replace it with the linux version?
Probably apt-get install python-lxml or the like.
@Ignacio I saw one of your earlier posts and tried apt-get install python-lxml already. This is like the aftermath
Well, remove the egg that has been built for the wrong OS then.
I get a similar problem with another library. As I used macos, python use native lib witch is no compatible with azure cloud function Linux os. I used a python docker image to build .python_packages dependencies.
0

simply do a

pip install -U lxml 

I had the same error, and it found an update to the existing installation and fixed it for me.

You might have to prefix sudo depending upon whether you are using a Virtual Environment or not

Comments

0

I got this error because I was trying to install tf 1.2 with venv built with python 3.6+. the issue was incompatible dependencies. For starters, please check if you are not doing that mistake by checking tested builds here https://www.tensorflow.org/install/source?hl=en#tested_build_configurations

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.