huggingface / neuralcoref

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

Unable to pip install neuralcoref #297

Closed iris-lux closed 3 years ago

iris-lux commented 3 years ago

Whenever I attempt to pip install neuralcoref, I get an error and it does not install.

Here's what it looks like:

Installing collected packages: neuralcoref Running setup.py install for neuralcoref ... error ERROR: Command errored out with exit status 1: command: nc-test/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tj/6n70l5211nn79y7_5qg1hyq80000gn/T/pip-install-_3bporz4/neuralcoref_9e8c82c8e14145d3a2660bcc4b5aa271/setup.py'"'"'; file='"'"'/private/var/folders/tj/6n70l5211nn79y7_5qg1hyq80000gn/T/pip-install-_3bporz4/neuralcoref_9e8c82c8e14145d3a2660bcc4b5aa271/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/tj/6n70l5211nn79y7_5qg1hyq80000gn/T/pip-record-v2_f80dd/install-record.txt --single-version-externally-managed --compile --install-headers nc-test/venv/include/site/python3.9/neuralcoref cwd: /private/var/folders/tj/6n70l5211nn79y7_5qg1hyq80000gn/T/pip-install-_3bporz4/neuralcoref_9e8c82c8e14145d3a2660bcc4b5aa271/ Complete output (101 lines): WARNING: The wheel package is not available. running install running build running build_py creating build creating build/lib.macosx-10.9-x86_64-3.9 creating build/lib.macosx-10.9-x86_64-3.9/neuralcoref copying neuralcoref/init.py -> build/lib.macosx-10.9-x86_64-3.9/neuralcoref copying neuralcoref/file_utils.py -> build/lib.macosx-10.9-x86_64-3.9/neuralcoref creating build/lib.macosx-10.9-x86_64-3.9/neuralcoref/tests copying neuralcoref/tests/init.py -> build/lib.macosx-10.9-x86_64-3.9/neuralcoref/tests copying neuralcoref/tests/test_neuralcoref.py -> build/lib.macosx-10.9-x86_64-3.9/neuralcoref/tests creating build/lib.macosx-10.9-x86_64-3.9/neuralcoref/train copying neuralcoref/train/algorithm.py -> build/lib.macosx-10.9-x86_64-3.9/neuralcoref/train copying neuralcoref/train/conllparser.py -> build/lib.macosx-10.9-x86_64-3.9/neuralcoref/train copying neuralcoref/train/compat.py -> build/lib.macosx-10.9-x86_64-3.9/neuralcoref/train copying neuralcoref/train/init.py -> build/lib.macosx-10.9-x86_64-3.9/neuralcoref/train copying neuralcoref/train/model.py -> build/lib.macosx-10.9-x86_64-3.9/neuralcoref/train copying neuralcoref/train/dataset.py -> build/lib.macosx-10.9-x86_64-3.9/neuralcoref/train copying neuralcoref/train/utils.py -> build/lib.macosx-10.9-x86_64-3.9/neuralcoref/train copying neuralcoref/train/document.py -> build/lib.macosx-10.9-x86_64-3.9/neuralcoref/train copying neuralcoref/train/learn.py -> build/lib.macosx-10.9-x86_64-3.9/neuralcoref/train copying neuralcoref/train/evaluator.py -> build/lib.macosx-10.9-x86_64-3.9/neuralcoref/train running build_ext building 'neuralcoref.neuralcoref' extension creating build/temp.macosx-10.9-x86_64-3.9 creating build/temp.macosx-10.9-x86_64-3.9/neuralcoref gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -I/private/var/folders/tj/6n70l5211nn79y7_5qg1hyq80000gn/T/pip-install-_3bporz4/neuralcoref_9e8c82c8e14145d3a2660bcc4b5aa271/include -I/nc-test/venv/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c neuralcoref/neuralcoref.cpp -o build/temp.macosx-10.9-x86_64-3.9/neuralcoref/neuralcoref.o -O2 -Wno-strict-prototypes -Wno-unused-function -stdlib=libc++ In file included from neuralcoref/neuralcoref.cpp:607: In file included from /private/var/folders/tj/6n70l5211nn79y7_5qg1hyq80000gn/T/pip-install-_3bporz4/neuralcoref_9e8c82c8e14145d3a2660bcc4b5aa271/include/numpy/arrayobject.h:15: In file included from /private/var/folders/tj/6n70l5211nn79y7_5qg1hyq80000gn/T/pip-install-_3bporz4/neuralcoref_9e8c82c8e14145d3a2660bcc4b5aa271/include/numpy/ndarrayobject.h:17: In file included from /private/var/folders/tj/6n70l5211nn79y7_5qg1hyq80000gn/T/pip-install-_3bporz4/neuralcoref_9e8c82c8e14145d3a2660bcc4b5aa271/include/numpy/ndarraytypes.h:1728: /private/var/folders/tj/6n70l5211nn79y7_5qg1hyq80000gn/T/pip-install-_3bporz4/neuralcoref_9e8c82c8e14145d3a2660bcc4b5aa271/include/numpy/npy_deprecated_api.h:11:2: warning: "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]

warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"

 ^
neuralcoref/neuralcoref.cpp:8989:40: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
    __pyx_t_5 = ((__pyx_v_maxchild_idx > __pyx_v_sent_start) != 0);
                  ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
neuralcoref/neuralcoref.cpp:9046:40: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
    __pyx_t_5 = ((__pyx_v_minchild_idx < (__pyx_v_sent_end - 1)) != 0);
                  ~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~
neuralcoref/neuralcoref.cpp:49313:54: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref_NeuralCoref.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49340:112: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct____pyx_f_11neuralcoref_11neuralcoref_get_span_type.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49346:71: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_1_genexpr.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49352:76: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_2_get_resolved.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49358:71: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_3_genexpr.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49364:122: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_4___pyx_f_11neuralcoref_11neuralcoref_extract_mentions_spans.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49370:71: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_5_genexpr.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49376:72: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_6___iter__.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49382:77: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_7_set_conv_dict.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49388:71: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_8_genexpr.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49394:68: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_9_pipe.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49400:72: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_10_predict.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49406:72: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_11_genexpr.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49412:72: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_12_genexpr.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49418:72: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_13_genexpr.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49424:72: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_14_genexpr.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49430:72: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_15_to_disk.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49436:74: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_16_from_disk.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
neuralcoref/neuralcoref.cpp:49442:73: error: no member named 'tp_print' in '_typeobject'
  __pyx_type_11neuralcoref_11neuralcoref___pyx_scope_struct_17_to_bytes.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
3 warnings and 20 errors generated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------

ERROR: Command errored out with exit status 1: nc-test/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tj/6n70l5211nn79y7_5qg1hyq80000gn/T/pip-install-_3bporz4/neuralcoref_9e8c82c8e14145d3a2660bcc4b5aa271/setup.py'"'"'; file='"'"'/private/var/folders/tj/6n70l5211nn79y7_5qg1hyq80000gn/T/pip-install-_3bporz4/neuralcoref_9e8c82c8e14145d3a2660bcc4b5aa271/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/tj/6n70l5211nn79y7_5qg1hyq80000gn/T/pip-record-v2_f80dd/install-record.txt --single-version-externally-managed --compile --install-headers nc-test/venv/include/site/python3.9/neuralcoref Check the logs for full command output.

fnl commented 3 years ago

Happens to me, too -- if I use spacy==3.0.3; It installs fine with spacy==2.3.5, though.

svlandeg commented 3 years ago

Hi! There is not a neuralcoref version compatible with spaCy 3.0.3 yet - but it's on the roadmap. Closing this issue and merging it with https://github.com/huggingface/neuralcoref/issues/295

sherr3h commented 2 years ago

I am using spacy 2.3.5 and also encountered this error.

polm commented 2 years ago

NeuralCoref hasn't had a release in a while, and the latest wheels only support up to Python 3.7.

Nathanlauga commented 2 years ago

I fixed this problem by downgrading python from 3.9 to 3.8

I found this answer on stackoverflow :

The tp_print method was removed from the API in Python 3.9. Error "'tp_print': is not a member of '_typeobject'" means that the code is intended for Python <= 3.8.

source : https://stackoverflow.com/questions/65462530/pyclipper-installation-error-tp-print-is-not-a-member-of-typeobject

deborahdjon commented 1 year ago

I'm using colab and had the same issue. I solved by running sudo apt-get install python3.7-dev. I downgraded to python3.7 but was missing this package.

I found the error by check the logs by running pip install neuralcoref --log log.txt. I also had to install the package from the source.

tkellogg commented 7 months ago

FWIW spaCy has experimental support for coreference resolution now. It might be better to just use that, since this doesn't appear to be updated anymore.

vaibhav54 commented 1 month ago

For me installation worked for: python: 3.8.0 spacy==3.7.5 neuralcoref==4.0