Default or fink python and lxml under 10.6.8

Posted by songdogtech on Super User See other posts from Super User or by songdogtech
Published on 2012-11-29T15:03:45Z Indexed on 2012/11/29 17:07 UTC
Read the original article Hit count: 577

Filed under:
|
|

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?

© Super User or respective owner

Related posts about osx

Related posts about osx-snow-leopard