我无法正常运行。
安装spacy pip install spacy
并运行$python -m spacy
后,我收到以下错误消息
$ 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'
卸载并重新安装spacy无法解决该问题。
供参考,我正在运行osx 10.14和python 3.6.7
答案 0 :(得分:5)
卸载Thinc和Cymem,然后重新安装Spacy为我解决了此问题
pip uninstall thinc
pip uninstall cymem
pip install spacy