Python3, Lxml And "symbol Not Found: _lzma_auto_decoder" On Mac Os X 10.9
Solution 1:
I have deleted all versions of python from
/Library/Frameworks/Python.framework/Versions/
afterwards I have reinstalled python 3 using brew and recreated the symlinks using
brew link --overwrite python3
Solution 2:
Deleting lxml and re-installing lxml a SECOND time worked for me (weird, not happy with this solution):
pip3.4 uninstall lxml
pip3.4 install lxml
pip3 complains about lxml being already installed, remove manually the install files with a command like:
rm -fr /private/var/folders/dj/saljfdsf12_sd7s89dfg9080000rb/T/pip_build_user/lxml
Then again:
pip3.4 install lxml
And it worked. I couldn't reproduce the original error message to find root cause of this problem.
Solution 3:
If you use Homebrew and have xz
installed, the following should work:
STATIC_DEPS=true CFLAGS=-I/usr/local/include/lzma pip install -U lxml
Otherwise set CFLAGS to the place where your lzma headers are located.
Solution 4:
I had this same issue,
What I did:
First, I ensured I did not have the ports py27-xml2
, py27-xslt
or py27-lxml
installed
sudo port installed | grep py27
I installed port py27-pip
and checked that $PATH variable pointed it. Also installed py27-setuptools
.
$ sudo port contents py27-pip | grep /pip$
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/pip
in ~/.bash_profile:
export PATH="/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
$ which pip
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/pip
Then I installed lxml
with easy_install which was located in the same directory than pip
STATIC_DEPS=true sudo easy_install-2.7 lxml
The building process was displaying:
$ STATIC_DEPS=true sudo easy_install-2.7 lxml
Searching for lxml
Reading https://pypi.python.org/simple/lxml/
Downloading
....
Building without Cython.
Using build configuration of libxslt 1.1.29
Building against libxml2/libxslt in the following directory: /Applications/MAMP/Library/
....
libxml/xmlversion.h: No such file or directory
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:
$ STATIC_DEPS=true sudo easy_install-2.7 -m "lxml==3.6.4"in ~/.bash_profile:
export PATH="/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}:/Applications/MAMP/Library/bin:/Applications/MAMP/Library"
$ source ~/.bash_profile
$ STATIC_DEPS=true sudo easy_install-2.7 lxml
This fixed the error either inside or outside virtualenv
$ python
Python 2.7.12 (default, Jun 292016, 12:46:54)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits"or"license"for more information.
>>> from lxml import etree
>>>
Post a Comment for "Python3, Lxml And "symbol Not Found: _lzma_auto_decoder" On Mac Os X 10.9"