Mac OS X 10.9 上的 Python3、lxml 和 "Symbol not found: _lzma_auto_decoder"

标签 python macos python-3.x lxml homebrew

我已经使用 Homebrew 软件安装了 python 3,然后安装了 pip3 和 lxml。

下面一行

from lxml import entree

导致以下错误:

$ 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();

有人知道如何解决这个问题吗?

最佳答案

我已经从

中删除了所有版本的python
      /Library/Frameworks/Python.framework/Versions/

之后,我使用 brew 重新安装了 python 3,并使用

重新创建了符号链接(symbolic link)
     brew link --overwrite python3

关于Mac OS X 10.9 上的 Python3、lxml 和 "Symbol not found: _lzma_auto_decoder",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23586239/

相关文章:

python - numba 不接受 dtype=object 的 numpy 数组

Python 应用程序因 "PyEval_RestoreThread: the function must be called with the GIL held, but the GIL is released"崩溃

python - mFailed 解析文本文件

python - 为什么 'decimal.Decimal(1)' 不是 'numbers.Real' 的实例?

python - sklearn.linear_model.LogisticRegression 中回归的工作原理

macos - 操作系统 : detect SPACEBAR down and up events

python - pip 安装抛出 MissingSectionHeaderError

python - virtualenvwrapper - 环境变量不保存

mysql - python、mysql 和 utf8mb4 的编码问题

python - PyQt 窗口未显示在屏幕上