0

I am now getting the undefined symbol: PyFPE_jbuf when trying import spacy on an Ubuntu 17.10.

>>> 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

This is in Python 2.7, while Python 3.6 works ok. I have (at least) the problem with spaCy 2.0.5 and 2.0.6.

The PyFPE_jbuf error has been reported for a number of other projects, e.g., sklearn (https://bugs.launchpad.net/ubuntu/+source/scikit-learn/+bug/1716004), numpy (numpy undefined symbol: PyFPE_jbuf), and lxml (undefined symbol: PyFPE_jbuf error while using 'lxml' on ubuntu). Here the general suggestion seems to be a reinstall. My sklearn, numpy, and lxml imports work fine.

I have tried

pip install --upgrade spacy

and

pip uninstall spacy
pip install spacy

These commands do not help.

Finn Årup Nielsen
  • 6,130
  • 1
  • 33
  • 43

1 Answers1

1

I fixed it myself. A forced reinstall including dependencies seems to work:

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

SpaCy now imports:

$ 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
>>> 

An upgrade of cytoolz with sudo pip install --upgrade cytoolz did only fix the problem in cytoolz. A new exception appeared with preshed.

Finn Årup Nielsen
  • 6,130
  • 1
  • 33
  • 43