带有spaCy的未定义符号PyFPE_jbuf

时间:2018-02-01 12:32:50

标签: python spacy

我现在在Ubuntu 17.10上尝试undefined symbol: PyFPE_jbuf时获得import spacy

>>> import spacy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/spacy/__init__.py", line 4, in <module>
    from .cli.info import info as cli_info
  File "/usr/local/lib/python2.7/dist-packages/spacy/cli/__init__.py", line 1, in <module>
    from .download import download
  File "/usr/local/lib/python2.7/dist-packages/spacy/cli/download.py", line 10, in <module>
    from .link import link
  File "/usr/local/lib/python2.7/dist-packages/spacy/cli/link.py", line 7, in <module>
    from ..compat import symlink_to, path2str
  File "/usr/local/lib/python2.7/dist-packages/spacy/compat.py", line 11, in <module>
    from thinc.neural.util import copy_array
  File "/usr/local/lib/python2.7/dist-packages/thinc/neural/__init__.py", line 1, in <module>
    from ._classes.model import Model
  File "/usr/local/lib/python2.7/dist-packages/thinc/neural/_classes/model.py", line 12, in <module>
    from ..train import Trainer
  File "/usr/local/lib/python2.7/dist-packages/thinc/neural/train.py", line 3, in <module>
    from .optimizers import Adam, SGD, linear_decay
  File "optimizers.pyx", line 13, in init thinc.neural.optimizers
  File "ops.pyx", line 18, in init thinc.neural.ops
  File "/usr/local/lib/python2.7/dist-packages/cytoolz/__init__.py", line 3, in <module>
    from .functoolz import *
ImportError: /usr/local/lib/python2.7/dist-packages/cytoolz/functoolz.so: undefined symbol: PyFPE_jbuf

这是在Python 2.7中,而Python 3.6工作正常。我(至少)有spaCy 2.0.5和2.0.6的问题。

已经报告了许多其他项目的PyFPE_jbuf错误,例如,sklearn(https://bugs.launchpad.net/ubuntu/+source/scikit-learn/+bug/1716004),numpy(numpy undefined symbol: PyFPE_jbuf)和lxml(undefined symbol: PyFPE_jbuf error while using 'lxml' on ubuntu)。这里的一般建议似乎是重新安装。我的sklearn,numpy和lxml导入工作正常。

我试过了

pip install --upgrade spacy

pip uninstall spacy
pip install spacy

这些命令无济于事。

1 个答案:

答案 0 :(得分:1)

我自己修好了。强制重新安装包括依赖项似乎有效:

$ sudo pip install --upgrade --force-reinstall spacy

SpaCy现在进口:

$ python2
Python 2.7.14 (default, Sep 23 2017, 22:06:14) 
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import spacy
>>> 

使用cytoolz升级sudo pip install --upgrade cytoolz只能解决cytoolz中的问题。 preshed出现了新的例外情况。