I have installed python 3 using homebrew and afterwards installed pip3 and lxml.
The following line
from lxml import entree
leads to the following error:
$ python3
Python 3.3.5 (v3.3.5:62cf4e77f785, Mar 9 2014, 01:12:57)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml import etree
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site- packages/lxml/etree.so, 2): Symbol not found: _lzma_auto_decoder
Referenced from: /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/lxml/etree.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/lxml/etree.so
>>> exit();
Does anybody know how to fix this?
If you use Homebrew and have
xz
installed, the following should work:Otherwise set CFLAGS to the place where your lzma headers are located.
I have deleted all versions of python from
afterwards I have reinstalled python 3 using brew and recreated the symlinks using
I had this same issue,
What I did:
First, I ensured I did not have the ports
py27-xml2
,py27-xslt
orpy27-lxml
installedI installed port
py27-pip
and checked that $PATH variable pointed it. Also installedpy27-setuptools
.Then I installed
lxml
with easy_install which was located in the same directory thanpip
The building process was displaying:
I moved MAMP (seems to already come with those libs) at the end of $PATH, uninstalled
lxml
(displayed "Symbol not found: _lzma_auto_decoder" error) and repeated last command:This fixed the error either inside or outside
virtualenv
Deleting lxml and re-installing lxml a SECOND time worked for me (weird, not happy with this solution):
pip3 complains about lxml being already installed, remove manually the install files with a command like:
Then again:
And it worked. I couldn't reproduce the original error message to find root cause of this problem.