Error after installing spacy package

0

I installed spacy package in python 3.6 but after installing I get this error when I want to import this package.

In [1]: import spacy
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-c080f6458562> in <module>()
----> 1 import spacy

C:\Users\Dsaad\Anaconda3\lib\site-packages\spacy\__init__.py in <module>()
      2 from __future__ import unicode_literals
      3
----> 4 from . import util
      5 from .deprecated import resolve_model_name
      6 from .cli import info

C:\Users\Dsaad\Anaconda3\lib\site-packages\spacy\util.py in <module>()
      3
      4 import ujson
----> 5 import regex as re
      6 from pathlib import Path
      7 import sys

C:\Users\Dsaad\Anaconda3\lib\site-packages\regex.py in <module>()
    392 # Internals.
    393
--> 394 import _regex_core
    395 import _regex
    396 from threading import RLock as _RLock

C:\Users\Dsaad\Anaconda3\lib\site-packages\_regex_core.py in <module>()
     19 from collections import defaultdict
     20
---> 21 import _regex
     22
     23 __all__ = ["A", "ASCII", "B", "BESTMATCH", "D", "DEBUG", "E", "ENHANCEMATCH",

ImportError: DLL load failed: The specified procedure could not be found.

DSaad

Posted 2017-05-08T21:11:09.980

Reputation: 337

Answers

1

I had this issue as well, but it was fixed after I created a conda environment and specified python=3.

conda create --name py36 python=3

This command installed a few new packages:

  • pip: 9.0.1-py36_1
  • python: 3.6.1-0
  • setuptools: 27.2.0-py36_1
  • vs2015_runtime: 14.0.25123-0
  • wheel: 0.29.0-py36_0

I suspect the installation of vs2015_runtime is what fixed this issue, but I haven't done a root cause analysis. Visual Studio is mentioned in the Spacy Windows installation section.

Also note if you use this solution you will need to activate the conda environment whenever you want to use it. (see conda envs activating environments docs)

John

Posted 2017-05-08T21:11:09.980

Reputation: 11

I've done all of that and I still have the problem. – DSaad – 2017-05-09T14:45:51.800