Lonneke Brakenhoff
Lonneke Brakenhoff

Reputation: 41

ImportError: DLL load failed importing spacy

I'm trying to import spaCy in python (in Windows), but with no luck so far. I installed a virtualenv and with both pip and Anaconda spacy. No problems with installing the package, but when I import spaCy (in a Jupyter Notebook) I get the following error:

[in] import spacy [out] [...] ImportError: DLL load failed: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.

When I run the input again the error messages is as follows:

[...] ImportError: cannot import name util

I'm not sure where to look for a solution. I thinking of a problem with version of other packages or maybe even with the Python version.

I'm currently using Python 2.7.13.

Upvotes: 4

Views: 2613

Answers (3)

Ctrd00
Ctrd00

Reputation: 53

If you don't want to use anaconda, installing the latest Visual C++ Redistributable (vc_redist.x64.exe) works flawlessly for me.

https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

Upvotes: 2

Nishank Mahore
Nishank Mahore

Reputation: 514

The Two things I needed to do to get spaCy working were:

  1. Install VC2008 Redist (64Bit) I used this link: > http://www.microsoft.com/download/en/details.aspx?id=20922.

  2. When I installed the model (I used Anaconda) ensure that I ran the Prompt as Administrator

Finally you might want to try using Anaconda. Works like a charm for me

Upvotes: 1

iFlo
iFlo

Reputation: 1494

This is a known issue and can be resolved following those links :

https://github.com/explosion/spaCy/issues/1199 & https://github.com/kbenoit/spacyr/issues/19

In a nutshell, it doesn't work because Visual C++ is not installed, and it uses the msvcrt90.dll that ships with Anaconda.

Upvotes: 0

Related Questions