Spacy language model installation in python returns ImportError from _mklinit (ImportError: DLL load failed: The specified module could not be found.)

…衆ロ難τιáo~ 提交于 2019-11-30 21:15:38

问题


I am currently trying to set up spaCy in my system. When I downloaded the module, no errors are being shown. However, upon downloading a language model (specifically, the english one), I got an error. The output is as follows:

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spacy\__init__.py", line 10, in <module>
    from thinc.neural.util import prefer_gpu, require_gpu
  File "C:\ProgramData\Anaconda3\lib\site-packages\thinc\__init__.py", line 5, in <module>
    import numpy  # noqa: F401
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\__init__.py", line 140, in <module>
    from . import _distributor_init
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\_distributor_init.py", line 34, in <module>
    from . import _mklinit
ImportError: DLL load failed: The specified module could not be found.

I have tried reinstalling my spaCy package, but still end up getting the same error. How do I deal with this?

I am using Python 3.7.1. Tried downloading using pip install -U spacy and conda install -c conda-forge spacy. I have also tried validating with python -m spacy validate, and it also returns the same error from above.

Thanks.


回答1:


Thanks to Ines Montani for pointing this out!

It did seem that a quick reinstallation of numpy helps solve the problem. However, what I did realize is that:

Using pip uninstall numpy and simple pip install numpy solves the problem.

However:

Using conda remove --force numpy and conda install numpy does not solve the problem for me.



来源:https://stackoverflow.com/questions/55280666/spacy-language-model-installation-in-python-returns-importerror-from-mklinit-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!