'How to fix "neuralcoref.pxd:1:0: 'spacy\tokens\doc.pxd' not found" when installing neuralcoref?

(neuralcoref_env) PS C:\Orcawise\Project\neuralcoref_env\newsclassification> pip install -r src_requirements.txt
Collecting neuralcoref
  Cloning https://github.com/huggingface/neuralcoref.git (to revision 60338df6f9b0a44a6728b442193b7c66653b0731) to c:\users\parth\appdata\local\temp\pip-install-63y0dxjn\neuralcoref_6fe7d814819a4723b09ac7aa4a060241
  Running command git clone --filter=blob:none --quiet https://github.com/huggingface/neuralcoref.git 'C:\Users\Parth\AppData\Local\Temp\pip-install-63y0dxjn\neuralcoref_6fe7d814819a4723b09ac7aa4a060241'
  Running command git rev-parse -q --verify 'sha^60338df6f9b0a44a6728b442193b7c66653b0731'
  Running command git fetch -q https://github.com/huggingface/neuralcoref.git 60338df6f9b0a44a6728b442193b7c66653b0731
  Resolved https://github.com/huggingface/neuralcoref.git to commit 60338df6f9b0a44a6728b442193b7c66653b0731
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [35 lines of output]
      c:\orcawise\project\neuralcoref_env\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\Parth\AppData\Local\Temp\pip-install-63y0dxjn\neuralcoref_6fe7d814819a4723b09ac7aa4a060241\neuralcoref\neuralcoref.pxd
        tree = Parsing.p_module(s, pxd, full_module_name)

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      from spacy.tokens.doc cimport Doc
      ^
      ------------------------------------------------------------

      neuralcoref.pxd:1:0: 'spacy\tokens\doc.pxd' not found
      Processing neuralcoref.pyx
      Traceback (most recent call last):
        File "C:\Users\Parth\AppData\Local\Temp\pip-install-63y0dxjn\neuralcoref_6fe7d814819a4723b09ac7aa4a060241\bin\cythonize.py", line 168, in <module>        
          run(args.root)
        File "C:\Users\Parth\AppData\Local\Temp\pip-install-63y0dxjn\neuralcoref_6fe7d814819a4723b09ac7aa4a060241\bin\cythonize.py", line 157, in run
          process(base, filename, db)
        File "C:\Users\Parth\AppData\Local\Temp\pip-install-63y0dxjn\neuralcoref_6fe7d814819a4723b09ac7aa4a060241\bin\cythonize.py", line 123, in process
          preserve_cwd(base, process_pyx, root + ".pyx", root + ".cpp")
        File "C:\Users\Parth\AppData\Local\Temp\pip-install-63y0dxjn\neuralcoref_6fe7d814819a4723b09ac7aa4a060241\bin\cythonize.py", line 86, in preserve_cwd     
          func(*args)
        File "C:\Users\Parth\AppData\Local\Temp\pip-install-63y0dxjn\neuralcoref_6fe7d814819a4723b09ac7aa4a060241\bin\cythonize.py", line 62, in process_pyx      
          raise Exception("Cython failed")
      Exception: Cython failed
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Parth\AppData\Local\Temp\pip-install-63y0dxjn\neuralcoref_6fe7d814819a4723b09ac7aa4a060241\setup.py", line 239, in <module>
          setup_package()
        File "C:\Users\Parth\AppData\Local\Temp\pip-install-63y0dxjn\neuralcoref_6fe7d814819a4723b09ac7aa4a060241\setup.py", line 174, in setup_package
          generate_cython(root, 'neuralcoref')
        File "C:\Users\Parth\AppData\Local\Temp\pip-install-63y0dxjn\neuralcoref_6fe7d814819a4723b09ac7aa4a060241\setup.py", line 163, in generate_cython
          raise RuntimeError('Running cythonize failed')
      RuntimeError: Running cythonize failed
      Cythonizing sources
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source