0

Ah, confusion.

I'm trying to install a python library called lxml as needed by a python script. I've been through numerous SU quesitons and answers. I haven't been able to make much progress.

I run easy_install lxml and get:

Processing lxml-3.0.1-py2.6-macosx-10.6-universal.egg lxml 3.0.1 is already the active version in easy-install.pth

Using /Library/Python/2.6/site-packages/lxml-3.0.1-py2.6-macosx-10.6-universal.egg Processing dependencies for lxml Finished processing dependencies for lxml

but when I run my script, I get:

File "scraper.py", line 3, in import lxml.html File "/Library/Python/2.6/site-packages/lxml-3.0.1-py2.6-macosx-10.6-universal.egg/lxml/html/init.py", line 42, in from lxml import etree

ImportError: dlopen(/Library/Python/2.6/site-packages/lxml-3.0.1-py2.6-macosx-10.6-universal.egg/lxml/etree.so, 2): Symbol not found: _htmlParseChunk Referenced from: /Library/Python/2.6/site-packages/lxml-3.0.1-py2.6-macosx-10.6-universal.egg/lxml/etree.so

Expected in: flat namespace in /Library/Python/2.6/site-packages/lxml-3.0.1-py2.6-macosx-10.6-universal.egg/lxml/etree.so

I think that maybe I'm not using the correct python install? I've installed python with fink, but should I use OS X's python?

This is in my .profile:

test -r /sw/bin/init.sh && . /sw/bin/init.sh

which points to the fink install.

echo $PATH gives me:

/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/X11R6/bin

Should I change that to point to snow leopard's python? (Which is 2.6.1) In Library/, there is:

enter image description here

which are the lxml libaries I need, it appears, as well as requests.

And whereis python gives me /usr/bin/python

What do I do? How do I get python to use these libraries. And which python?

1 Answer 1

0

It seems that many of the issues with lxml are because of the multiple methods to installing it, many of which are dead ends. I took a look around and found a link with instructions for installation. Take a look...

http://lxml.de/installation.html#installation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.