Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cl.exe failed with status 2 when installing spaCy #2507

Closed
eslivna opened this issue Jul 4, 2018 · 4 comments
Closed

cl.exe failed with status 2 when installing spaCy #2507

eslivna opened this issue Jul 4, 2018 · 4 comments
Labels
install Installation issues more-info-needed This issue needs more information windows Issues related to Windows

Comments

@eslivna
Copy link

eslivna commented Jul 4, 2018

How to reproduce the problem

When I try to install spaCy I get the following error. I've looked for hours for a sollution but nothing seems to work.

Command used: pip install spacy
I downloaded Visual studio 2017 again with the extra c++ tools but nothing seems te work.

C:\Users\esliv>pip install spacy
Collecting spacy
  Using cached https://files.pythonhosted.org/packages/3c/31/e60f88751e48851b002f78a35221d12300783d5a43d4ef12fbf10cca96c3/spacy-2.0.11.tar.gz
Requirement already satisfied: numpy>=1.7 in c:\users\esliv\appdata\local\programs\python\python37-32\lib\site-packages (from spacy) (1.14.5)
Collecting murmurhash<0.29,>=0.28 (from spacy)
  Using cached https://files.pythonhosted.org/packages/5e/31/c8c1ecafa44db30579c8c457ac7a0f819e8b1dbc3e58308394fff5ff9ba7/murmurhash-0.28.0.tar.gz
Collecting cymem<1.32,>=1.30 (from spacy)
  Using cached https://files.pythonhosted.org/packages/f8/9e/273fbea507de99166c11cd0cb3fde1ac01b5bc724d9a407a2f927ede91a1/cymem-1.31.2.tar.gz
Collecting preshed<2.0.0,>=1.0.0 (from spacy)
  Using cached https://files.pythonhosted.org/packages/1b/ac/7c17b1fd54b60972785b646d37da2826311cca70842c011c4ff84fbe95e0/preshed-1.0.0.tar.gz
Collecting thinc<6.11.0,>=6.10.1 (from spacy)
  Using cached https://files.pythonhosted.org/packages/55/fd/e9f36081e6f53699943381858848f3b4d759e0dd03c43b98807dde34c252/thinc-6.10.2.tar.gz
Requirement already satisfied: plac<1.0.0,>=0.9.6 in c:\users\esliv\appdata\local\programs\python\python37-32\lib\site-packages (from spacy) (0.9.6)
Requirement already satisfied: pathlib in c:\users\esliv\appdata\local\programs\python\python37-32\lib\site-packages (from spacy) (1.0.1)
Collecting ujson>=1.35 (from spacy)
  Using cached https://files.pythonhosted.org/packages/16/c4/79f3409bc710559015464e5f49b9879430d8f87498ecdc335899732e5377/ujson-1.35.tar.gz
Requirement already satisfied: dill<0.3,>=0.2 in c:\users\esliv\appdata\local\programs\python\python37-32\lib\site-packages (from spacy) (0.2.8.2)
Collecting regex==2017.4.5 (from spacy)
  Using cached https://files.pythonhosted.org/packages/36/62/c0c0d762ffd4ffaf39f372eb8561b8d491a11ace5a7884610424a8b40f95/regex-2017.04.05.tar.gz
Collecting wrapt (from thinc<6.11.0,>=6.10.1->spacy)
  Using cached https://files.pythonhosted.org/packages/a0/47/66897906448185fcb77fc3c2b1bc20ed0ecca81a0f2f88eda3fc5a34fc3d/wrapt-1.10.11.tar.gz
Collecting tqdm<5.0.0,>=4.10.0 (from thinc<6.11.0,>=6.10.1->spacy)
  Using cached https://files.pythonhosted.org/packages/93/24/6ab1df969db228aed36a648a8959d1027099ce45fad67532b9673d533318/tqdm-4.23.4-py2.py3-none-any.whl
Collecting cytoolz<0.9,>=0.8 (from thinc<6.11.0,>=6.10.1->spacy)
  Using cached https://files.pythonhosted.org/packages/0f/e6/ccc124714dcc1bd511e64ddafb4d5d20ada2533b92e3173a4cf09e0d0831/cytoolz-0.8.2.tar.gz
Requirement already satisfied: six<2.0.0,>=1.10.0 in c:\users\esliv\appdata\local\programs\python\python37-32\lib\site-packages (from thinc<6.11.0,>=6.10.1->spacy) (1.11.0)
Collecting termcolor (from thinc<6.11.0,>=6.10.1->spacy)
  Using cached https://files.pythonhosted.org/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz
Collecting msgpack-python (from thinc<6.11.0,>=6.10.1->spacy)
  Using cached https://files.pythonhosted.org/packages/8a/20/6eca772d1a5830336f84aca1d8198e5a3f4715cd1c7fc36d3cc7f7185091/msgpack-python-0.5.6.tar.gz
Collecting msgpack-numpy==0.4.1 (from thinc<6.11.0,>=6.10.1->spacy)
  Using cached https://files.pythonhosted.org/packages/2e/43/393e30e2768b0357541ac95891f96b80ccc4d517e0dd2fa3042fc8926538/msgpack_numpy-0.4.1-py2.py3-none-any.whl
Requirement already satisfied: pyreadline>=1.7.1 in c:\users\esliv\appdata\local\programs\python\python37-32\lib\site-packages (from dill<0.3,>=0.2->spacy) (2.1)
Collecting toolz>=0.8.0 (from cytoolz<0.9,>=0.8->thinc<6.11.0,>=6.10.1->spacy)
  Using cached https://files.pythonhosted.org/packages/14/d0/a73c15bbeda3d2e7b381a36afb0d9cd770a9f4adc5d1532691013ba881db/toolz-0.9.0.tar.gz
Installing collected packages: murmurhash, cymem, preshed, wrapt, tqdm, toolz, cytoolz, termcolor, msgpack-python, msgpack-numpy, thinc, ujson, regex, spacy
  Running setup.py install for murmurhash ... done
  Running setup.py install for cymem ... done
  Running setup.py install for preshed ... error
    Complete output from command c:\users\esliv\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\esliv\\AppData\\Local\\Temp\\pip-install-0lxffpwo\\preshed\\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\esliv\AppData\Local\Temp\pip-record-ksqrq1ug\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.7
    creating build\lib.win32-3.7\preshed
    copying preshed\about.py -> build\lib.win32-3.7\preshed
    copying preshed\__init__.py -> build\lib.win32-3.7\preshed
    creating build\lib.win32-3.7\preshed\tests
    copying preshed\tests\test_counter.py -> build\lib.win32-3.7\preshed\tests
    copying preshed\tests\test_hashing.py -> build\lib.win32-3.7\preshed\tests
    copying preshed\tests\test_pop.py -> build\lib.win32-3.7\preshed\tests
    copying preshed\tests\__init__.py -> build\lib.win32-3.7\preshed\tests
    copying preshed\counter.pyx -> build\lib.win32-3.7\preshed
    copying preshed\maps.pyx -> build\lib.win32-3.7\preshed
    copying preshed\counter.pxd -> build\lib.win32-3.7\preshed
    copying preshed\maps.pxd -> build\lib.win32-3.7\preshed
    copying preshed\__init__.pxd -> build\lib.win32-3.7\preshed
    running build_ext
    building 'preshed.maps' extension
    creating build\temp.win32-3.7
    creating build\temp.win32-3.7\Release
    creating build\temp.win32-3.7\Release\preshed
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\esliv\appdata\local\programs\python\python37-32\include -IC:\Users\esliv\AppData\Local\Temp\pip-install-0lxffpwo\preshed\include -Ic:\users\esliv\appdata\local\programs\python\python37-32\include -Ic:\users\esliv\appdata\local\programs\python\python37-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /EHsc /Tppreshed/maps.cpp /Fobuild\temp.win32-3.7\Release\preshed/maps.obj /Ox /EHsc
    maps.cpp
    preshed/maps.cpp(1128): warning C4018: '<': signed/unsigned mismatch
    preshed/maps.cpp(2385): warning C4244: '=': conversion from '__pyx_t_7preshed_4maps_key_t' to 'Py_ssize_t', possible loss of data
    preshed/maps.cpp(3979): warning C4244: '=': conversion from '__pyx_t_7preshed_4maps_key_t' to 'size_t', possible loss of data
    preshed/maps.cpp(3999): warning C4244: '=': conversion from '__pyx_t_7preshed_4maps_key_t' to 'size_t', possible loss of data
    preshed/maps.cpp(6642): error C2039: 'exc_type': is not a member of '_ts'
    c:\users\esliv\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
    preshed/maps.cpp(6643): error C2039: 'exc_value': is not a member of '_ts'
    c:\users\esliv\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
    preshed/maps.cpp(6644): error C2039: 'exc_traceback': is not a member of '_ts'
    c:\users\esliv\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
    preshed/maps.cpp(6645): error C2039: 'exc_type': is not a member of '_ts'
    c:\users\esliv\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
    preshed/maps.cpp(6646): error C2039: 'exc_value': is not a member of '_ts'
    c:\users\esliv\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
    preshed/maps.cpp(6647): error C2039: 'exc_traceback': is not a member of '_ts'
    c:\users\esliv\appdata\local\programs\python\python37-32\include\pystate.h(209): note: see declaration of '_ts'
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "c:\users\esliv\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\esliv\\AppData\\Local\\Temp\\pip-install-0lxffpwo\\preshed\\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\esliv\AppData\Local\Temp\pip-record-ksqrq1ug\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\esliv\AppData\Local\Temp\pip-install-0lxffpwo\preshed\

Your Environment

  • Operating System: Windows
  • Python Version Used: 3.7
@ines ines added install Installation issues windows Issues related to Windows labels Jul 5, 2018
@ines
Copy link
Member

ines commented Jul 5, 2018

Hmm, this seems to be some issue with the compiler. There are many similar reports on StackOverflow for other libraries, but I haven't been able to find a definitive solution, just lots of different suggestions. Sorry if this is frustrating, I definitely feel you pain.

In the meantime, here are two alternative solutions:

Install from conda instead

Conda ships with pre-built wheels for Windows, which you don't have to compile locally. (If you're not using conda yet, you don't have to install the whole distribution btw – just installing "Miniconda" is fine.)

conda install -c conda-forge spacy 

Install the unofficial Windows binaries

See here for spaCy and its dependencies:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#spacy

Wheels can be installed just like a Python package by pointing pip to the local path of the downloaded file. For example:

pip install C:\users\you\downloads\xxxxx.whl

The file names indicate the platform. cpxx is the Python version, so you need the wheels with cp37‑cp37m. The second part indicates whether the wheel is for the 32 bit or the 64 bit version of Windows.

@ines ines added the more-info-needed This issue needs more information label Jul 10, 2018
@mehmetilker
Copy link

I had same problem with fresh install Win 10 + Python 3.7
I have downgraded to Python 3.6 and problem solved.

@ines
Copy link
Member

ines commented Jul 20, 2018

See #2490 for updates on Python 3.7 – should be resolved soon!

@ines ines closed this as completed Jul 20, 2018
@lock
Copy link

lock bot commented Sep 2, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
install Installation issues more-info-needed This issue needs more information windows Issues related to Windows
Projects
None yet
Development

No branches or pull requests

3 participants