huggingface / neuralcoref

✨Fast Coreference Resolution in spaCy with Neural Networks
https://huggingface.co/coref/
MIT License
2.83k stars 474 forks source link

Can't install using Python 3.9 #327

Open uluhonolulu opened 2 years ago

uluhonolulu commented 2 years ago

I'm getting an error running pip install neuralcoref on a Windows machine with Python 3.9 installed:

Using legacy 'setup.py install' for neuralcoref, since package 'wheel' is not installed.
Installing collected packages: neuralcoref
    Running setup.py install for neuralcoref ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Projects\trinity-ie\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lulalu.DESKTOP-64MTQG5\\AppData\\Local\\Temp\\pip-install-25y5o6vl\\neuralcoref_229b40a695a545e1982c0e88f0e52c65\\setup.py'"'"'; __file__='"'"'C:\\Users\\lulalu.DESKTOP-64MTQG5\\AppData\\Local\\Temp\\pip-install-25y5o6vl\\neuralcoref_229b40a695a545e1982c0e88f0e52c65\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\lulalu.DESKTOP-64MTQG5\AppData\Local\Temp\pip-record-e3llvivz\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Projects\trinity-ie\include\site\python3.9\neuralcoref'
         cwd: C:\Users\lulalu.DESKTOP-64MTQG5\AppData\Local\Temp\pip-install-25y5o6vl\neuralcoref_229b40a695a545e1982c0e88f0e52c65\
    Complete output (108 lines):
    WARNING: The wheel package is not available.
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.9
    creating build\lib.win-amd64-3.9\neuralcoref
    copying neuralcoref\file_utils.py -> build\lib.win-amd64-3.9\neuralcoref
    copying neuralcoref\__init__.py -> build\lib.win-amd64-3.9\neuralcoref
    creating build\lib.win-amd64-3.9\neuralcoref\tests
    copying neuralcoref\tests\test_neuralcoref.py -> build\lib.win-amd64-3.9\neuralcoref\tests
    copying neuralcoref\tests\__init__.py -> build\lib.win-amd64-3.9\neuralcoref\tests
    creating build\lib.win-amd64-3.9\neuralcoref\train
    copying neuralcoref\train\algorithm.py -> build\lib.win-amd64-3.9\neuralcoref\train
    copying neuralcoref\train\compat.py -> build\lib.win-amd64-3.9\neuralcoref\train
    copying neuralcoref\train\conllparser.py -> build\lib.win-amd64-3.9\neuralcoref\train
    copying neuralcoref\train\dataset.py -> build\lib.win-amd64-3.9\neuralcoref\train
    copying neuralcoref\train\document.py -> build\lib.win-amd64-3.9\neuralcoref\train
    copying neuralcoref\train\evaluator.py -> build\lib.win-amd64-3.9\neuralcoref\train
    copying neuralcoref\train\learn.py -> build\lib.win-amd64-3.9\neuralcoref\train
    copying neuralcoref\train\model.py -> build\lib.win-amd64-3.9\neuralcoref\train
    copying neuralcoref\train\utils.py -> build\lib.win-amd64-3.9\neuralcoref\train
    copying neuralcoref\train\__init__.py -> build\lib.win-amd64-3.9\neuralcoref\train
    running build_ext
    building 'neuralcoref.neuralcoref' extension
    creating build\temp.win-amd64-3.9
    creating build\temp.win-amd64-3.9\Release
    creating build\temp.win-amd64-3.9\Release\neuralcoref
    C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Program Files\Python39\include -IC:\Users\lulalu.DESKTOP-64MTQG5\AppData\Local\Temp\pip-install-25y5o6vl\neuralcoref_229b40a695a545e1982c0e88f0e52c65\include -IC:\Projects\trinity-ie\include -IC:\Program Files\Python39\include -IC:\Program Files\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt /EHsc /Tpneuralcoref/neuralcoref.cpp /Fobuild\temp.win-amd64-3.9\Release\neuralcoref/neuralcoref.obj /Ox /EHsc
    neuralcoref.cpp
    c:\users\lulalu.desktop-64mtqg5\appdata\local\temp\pip-install-25y5o6vl\neuralcoref_229b40a695a545e1982c0e88f0e52c65\include\numpy\npy_deprecated_api.h(8) : 
Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION

(bunch ow warnings omitted)

    neuralcoref/neuralcoref.cpp(49313): error C2039: 'tp_print': is not a member of '_typeobject'
    c:\program files\python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
    neuralcoref/neuralcoref.cpp(49340): error C2039: 'tp_print': is not a member of '_typeobject'
    c:\program files\python39\include\cpython/object.h(193): note: see declaration of '_typeobject'

(bunch of identical errors omitted)

    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Projects\trinity-ie\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lulalu.DESKTOP-64MTQG5\\AppData\\Local\\Temp\\pip-install-25y5o6vl\\neuralcoref_229b40a695a545e1982c0e88f0e52c65\\setup.py'"'"'; __file__='"'"'C:\\Users\\lulalu.DESKTOP-64MTQG5\\AppData\\Local\\Temp\\pip-install-25y5o6vl\\neuralcoref_229b40a695a545e1982c0e88f0e52c65\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\lulalu.DESKTOP-64MTQG5\AppData\Local\Temp\pip-record-e3llvivz\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Projects\trinity-ie\include\site\python3.9\neuralcoref' Check the logs for full command output.

I've installed spacy 2.3.5 for the same project.

sanaullahaq commented 2 years ago

@uluhonolulu did you find any solution? facing the same problem. I'm using Python 3.9.6

uluhonolulu commented 2 years ago

@sanaullahaq I'm using a 3.8-based docker image for my project. A virtual environment also works.

uluhonolulu commented 2 years ago

@sanaullahaq maybe you could use this instead: https://github.com/msg-systems/coreferee