Skip to content Skip to sidebar Skip to footer

Import Lxml Fails On Osx After (seemingly) Successful Install

I'm trying to install lxml for python on OS X 10.6.8 I ran sudo env ARCHFLAGS='-arch i386 -arch x86_64' easy_install lxml in the terminal based on this answer to a question install

Solution 1:

You've installed a newer version of Python (2.7.2) but you also need to install and use a copy of easy_install (from Distribute or setuptools) to use with it. You ended up using the default Apple-supplied version of easy_install associated with the Apple-supplied Python 2.6. Note the /Library/Python/2.6 in the easy_install output. (You can verify that by trying to import lxml when using /usr/bin/python2.6.) After you install easy_install using your Python 2.7, the new easy_install should be first on your shell path if you used the standard python.org installer defaults. If not, update your PATH:

export PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"

Then easy_install lxmlusing it. With the python.org 2.7.2, you shouldn't need to add the ARCHFLAGS environment variable but it doesn't hurt.

Solution 2:

You should just be able to run:

sudo env ARCHFLAGS="-arch i386 -arch x86_64" easy_install-2.7 lxml

This will use the easy_install version that came with your 2.7 installation.

Post a Comment for "Import Lxml Fails On Osx After (seemingly) Successful Install"