Import Lxml Fails On OSX After (seemingly) Successful 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 lxml
using 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"