coradek
coradek

Reputation: 517

spacy fails to run with error: 'cymem.cymem' has no attribute 'PyMalloc'

I am unable to get spacy to run.

After installing spacy pip install spacy and running $python -m spacy I received the following error

$ python -m spacy
Traceback (most recent call last):
  File "/Users/i862304/anaconda3/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/Users/i862304/anaconda3/lib/python3.6/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/Users/i862304/anaconda3/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/Users/i862304/anaconda3/lib/python3.6/site-packages/spacy/__init__.py", line 8, in <module>
    from thinc.neural.util import prefer_gpu, require_gpu
  File "/Users/i862304/anaconda3/lib/python3.6/site-packages/thinc/neural/__init__.py", line 1, in <module>
    from ._classes.model import Model
  File "/Users/i862304/anaconda3/lib/python3.6/site-packages/thinc/neural/_classes/model.py", line 11, in <module>
    from .. import util
  File "/Users/i862304/anaconda3/lib/python3.6/site-packages/thinc/neural/util.py", line 3, in <module>
    from preshed.maps import PreshMap
  File "cymem.pxd", line 4, in init preshed.maps
AttributeError: module 'cymem.cymem' has no attribute 'PyMalloc'

Uninstalling and reinstalling spacy did not fix the issue.
For reference I am running osx 10.14 and python 3.6.7

Upvotes: 8

Views: 7156

Answers (1)

coradek
coradek

Reputation: 517

Uninstalling thinc and cymem and then reinstalling spacy fixed this issue for me

pip uninstall thinc
pip uninstall cymem
pip install spacy

Upvotes: 13

Related Questions