1

EDIT: see the comments for the correct answer.

Hi Guys here is a problem I have been having that deals with installing the NLP program SpaCY.

I tried both pip install -U spacy and pip install spacy, but I seem to get the same error. I tried this on three separate computers. I am trying to install via Visual Studio 2017 Preview.

It seems like every thing is fine until I get the following error:

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools Command "C:\Users\kevin\Anaconda3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\kevin\AppData\Local\Temp\pip-build-jy_zc2z4\murmurhash\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\kevin\AppData\Local\Temp\pip-xagjck4j-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\kevin\AppData\Local\Temp\pip-build-jy_zc2z4\murmurhash\

So I went to the website listed in the error and it was very vague in what I need to install so I just went back to the Visual Studio 2017 Preview Installer and Clicked "Modify". I already had many of the tools for C++ installed but I just clicked as many C++ unchecked boxes as I could see. Then I tried again and I still get the same error. I'm not sure what to try next. I also tried to install on my computer that runs linux and I still got the murmurhash part. Does anyone have any ideas? I used to love pip but now it just drives me crazy all the time.

I've checked other SpaCy Installation Error posts. There are a couple that are similar to mine but not the same.

Thanks

Kevin
  • 391
  • 3
  • 6
  • 22
  • Pip downloads .whl files - they include desired library files + installation script, you can try to open it with 7-zip or other archiver tool and edit installation script. Then you install it from this edited .whl file eg. pip install package.whl – Zydnar May 01 '17 at 12:03
  • @Zydnar thanks man ill take a look at doing that! Ill let u know if it works! – Kevin May 01 '17 at 12:04
  • Visual C++ 14.0 is Visual Studio 2015. You can install it side-by-side with VS2017. Presumably there is some dependency on VS2105 and it hasn't been updated for VS2017. – stanthomas May 03 '17 at 00:29
  • @stanthomas I will try that out tonight thanks – Kevin May 03 '17 at 03:52
  • @stanthomas It worked on VS 2015 Thanks! – Kevin May 08 '17 at 07:15
  • Another tip. For me it failed with python3-32 but worked with python3-64. – new name Aug 14 '19 at 21:26

1 Answers1

2

I have the similar problems as yours. And the short answer is using conda instead of pip to install spacy. Try conda install spacy because it will automatically install the dependencies. I suffered a lot using pip as it needs corresponding VSC++2015(for python 3.5+) compiler tools to build the source while installing spacy.

By the way, download the spacy whl file and then use pip install doesn't work out for me.

Charles Ye
  • 69
  • 7