Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 649
Lonneke Brakenhoff Avatar asked Oct 24 '25 07:10

Lonneke Brakenhoff


2 Answers

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

like image 195
Ctrd00 Avatar answered Oct 25 '25 21:10

Ctrd00


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

like image 32
Nishank Mahore Avatar answered Oct 25 '25 19:10

Nishank Mahore



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!