neuralcoref icon indicating copy to clipboard operation
neuralcoref copied to clipboard

Installing neuralcoref throws RuntimeError: Running cythonize failed

Open nsorros opened this issue 4 years ago • 1 comments

pip install git+https://github.com/huggingface/neuralcoref.git throws

RuntimeError: Running cythonize failed
  Cythonizing sources

more details below

Including pip install cython before seems to fix it, is this the intended way to install?

My environment: Python version: 3.7.5 Pip version: 21.3.1 uname: Darwin

Collecting git+https://github.com/huggingface/neuralcoref.git
  Cloning https://github.com/huggingface/neuralcoref.git to /private/var/folders/f1/x6zj7pg94m3fv0klkqwtjhnm0000gn/T/pip-req-build-azgj9svo
  Running command git clone -q https://github.com/huggingface/neuralcoref.git /private/var/folders/f1/x6zj7pg94m3fv0klkqwtjhnm0000gn/T/pip-req-build-azgj9svo
  Resolved https://github.com/huggingface/neuralcoref.git to commit 60338df6f9b0a44a6728b442193b7c66653b0731
    ERROR: Command errored out with exit status 1:
     command: /Users/nsorros/code/test/neural_coref/venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/f1/x6zj7pg94m3fv0klkqwtjhnm0000gn/T/pip-req-build-azgj9svo/setup.py'"'"'; __file__='"'"'/private/var/folders/f1/x6zj7pg94m3fv0klkqwtjhnm0000gn/T/pip-req-build-azgj9svo/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'"'"'))' egg_info --egg-base /private/var/folders/f1/x6zj7pg94m3fv0klkqwtjhnm0000gn/T/pip-pip-egg-info-uc1rbq7i
         cwd: /private/var/folders/f1/x6zj7pg94m3fv0klkqwtjhnm0000gn/T/pip-req-build-azgj9svo/
    Complete output (39 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'Cython'
    Processing neuralcoref.pyx
    Traceback (most recent call last):
      File "/private/var/folders/f1/x6zj7pg94m3fv0klkqwtjhnm0000gn/T/pip-req-build-azgj9svo/bin/cythonize.py", line 59, in process_pyx
        ["cython"] + flags + ["-o", tofile, fromfile], env=os.environ
      File "/Users/nsorros/.pyenv/versions/3.7.9/lib/python3.7/subprocess.py", line 339, in call
        with Popen(*popenargs, **kwargs) as p:
      File "/Users/nsorros/.pyenv/versions/3.7.9/lib/python3.7/subprocess.py", line 800, in __init__
        restore_signals, start_new_session)
      File "/Users/nsorros/.pyenv/versions/3.7.9/lib/python3.7/subprocess.py", line 1551, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: 'cython': 'cython'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/private/var/folders/f1/x6zj7pg94m3fv0klkqwtjhnm0000gn/T/pip-req-build-azgj9svo/bin/cythonize.py", line 168, in <module>
        run(args.root)
      File "/private/var/folders/f1/x6zj7pg94m3fv0klkqwtjhnm0000gn/T/pip-req-build-azgj9svo/bin/cythonize.py", line 157, in run
        process(base, filename, db)
      File "/private/var/folders/f1/x6zj7pg94m3fv0klkqwtjhnm0000gn/T/pip-req-build-azgj9svo/bin/cythonize.py", line 123, in process
        preserve_cwd(base, process_pyx, root + ".pyx", root + ".cpp")
      File "/private/var/folders/f1/x6zj7pg94m3fv0klkqwtjhnm0000gn/T/pip-req-build-azgj9svo/bin/cythonize.py", line 86, in preserve_cwd
        func(*args)
      File "/private/var/folders/f1/x6zj7pg94m3fv0klkqwtjhnm0000gn/T/pip-req-build-azgj9svo/bin/cythonize.py", line 77, in process_pyx
        raise Exception("Cython failed")
    Exception: Cython failed
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/f1/x6zj7pg94m3fv0klkqwtjhnm0000gn/T/pip-req-build-azgj9svo/setup.py", line 239, in <module>
        setup_package()
      File "/private/var/folders/f1/x6zj7pg94m3fv0klkqwtjhnm0000gn/T/pip-req-build-azgj9svo/setup.py", line 174, in setup_package
        generate_cython(root, 'neuralcoref')
      File "/private/var/folders/f1/x6zj7pg94m3fv0klkqwtjhnm0000gn/T/pip-req-build-azgj9svo/setup.py", line 163, in generate_cython
        raise RuntimeError('Running cythonize failed')
    RuntimeError: Running cythonize failed
    Cythonizing sources
    ----------------------------------------
WARNING: Discarding git+https://github.com/huggingface/neuralcoref.git. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

nsorros avatar Nov 18 '21 16:11 nsorros