Coder Social home page Coder Social logo

Getting requirements to build wheel ... error >>> Error compiling Cython file: spacy/vocab.pxd:28:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead. about cso-classifier HOT 4 OPEN

angelosalatino avatar angelosalatino commented on May 30, 2024
Getting requirements to build wheel ... error >>> Error compiling Cython file: spacy/vocab.pxd:28:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.

from cso-classifier.

Comments (4)

angelosalatino avatar angelosalatino commented on May 30, 2024

Hi,

Have you tried to use python 3.7? or on a brand new environment?

I am sorry, but this is a new issue that I have never encountered before.

from cso-classifier.

maprann avatar maprann commented on May 30, 2024

Hi Angelo. Thank you for the quick reply. I will try and come back to you.
In the meantime I discovered this: https://cython.readthedocs.io/en/latest/src/changes.html
in the "related changes:" section :
Variables can no longer be declared with cpdef. Patch by David Woods. (Github issue #887)

from cso-classifier.

maprann avatar maprann commented on May 30, 2024

Hello @angelosalatino - I tried with python 3.7.17 on Mac, VSCode, ZSh, and a new venv -- I have the same error.
Cython.Compiler.Errors.CompileError: spacy/kb.pyx

❯ python -m venv outdovenv
❯ source outdovenv/bin/activate
❯ pip list
Package Version
pip 23.0.1
setuptools 47.1.0
❯ pyenv version
3.7.17 (set by /Users/maisonsirginou/.pyenv/version)
❯ pyenv versions
system
3.6.15
==> 3.7.17 (set by /Users/maisonsirginou/.pyenv/version)
3.8.17
3.9.17
......
====> Error below <====

 > pip install cso-classifier
Collecting cso-classifier
  Obtaining dependency information for cso-classifier from https://files.pythonhosted.org/packages/e3/77/85c910382095e77bf6a431b3e3d9fb588c4db6d2f455c18dfd9dc620dbaf/cso_classifier-3.1-py3-none-any.whl.metadata
  Using cached cso_classifier-3.1-py3-none-any.whl.metadata (43 kB)
Collecting gensim==3.8.3 (from cso-classifier)
  Using cached gensim-3.8.3.tar.gz (23.4 MB)
  Preparing metadata (setup.py) ... done
Collecting click==7.1.2 (from cso-classifier)
  Using cached click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting hurry.filesize==0.9 (from cso-classifier)
  Using cached hurry.filesize-0.9.tar.gz (2.8 kB)
  Preparing metadata (setup.py) ... done
Collecting kneed==0.3.1 (from cso-classifier)
  Using cached kneed-0.3.1.tar.gz (9.1 kB)
  Preparing metadata (setup.py) ... done
Collecting nltk==3.6.2 (from cso-classifier)
  Using cached nltk-3.6.2-py3-none-any.whl (1.5 MB)
Collecting rapidfuzz==2.11.1 (from cso-classifier)
  Using cached rapidfuzz-2.11.1.tar.gz (813 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.19.5 in /Users/maisonsirginou/.pyenv/versions/3.7.17/lib/python3.7/site-packages (from cso-classifier) (1.21.6)
Collecting requests==2.25.1 (from cso-classifier)
  Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB)
Collecting spacy==3.0.5 (from cso-classifier)
  Using cached spacy-3.0.5.tar.gz (7.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [164 lines of output]
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          int length
      
      
      cdef class Vocab:
          cdef Pool mem
          cpdef readonly StringStore strings
                ^
      ------------------------------------------------------------
      
      spacy/vocab.pxd:28:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      
      
      cdef class Vocab:
          cdef Pool mem
          cpdef readonly StringStore strings
          cpdef public Morphology morphology
                ^
      ------------------------------------------------------------
      
      spacy/vocab.pxd:29:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      
      cdef class Vocab:
          cdef Pool mem
          cpdef readonly StringStore strings
          cpdef public Morphology morphology
          cpdef public object vectors
                ^
      ------------------------------------------------------------
      
      spacy/vocab.pxd:30:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      cdef class Vocab:
          cdef Pool mem
          cpdef readonly StringStore strings
          cpdef public Morphology morphology
          cpdef public object vectors
          cpdef public object _lookups
                ^
      ------------------------------------------------------------
      
      spacy/vocab.pxd:31:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          cdef Pool mem
          cpdef readonly StringStore strings
          cpdef public Morphology morphology
          cpdef public object vectors
          cpdef public object _lookups
          cpdef public object writing_system
                ^
      ------------------------------------------------------------
      
      spacy/vocab.pxd:32:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          cpdef readonly StringStore strings
          cpdef public Morphology morphology
          cpdef public object vectors
          cpdef public object _lookups
          cpdef public object writing_system
          cpdef public object get_noun_chunks
                ^
      ------------------------------------------------------------
      
      spacy/vocab.pxd:33:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          cdef float prior_prob
      
      
      cdef class KnowledgeBase:
          cdef Pool mem
          cpdef readonly Vocab vocab
                ^
      ------------------------------------------------------------
      
      spacy/kb.pxd:31:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
      Copied /private/var/folders/xk/5rw7rdq566x_h9w02mgphnn80000gn/T/pip-install-w8m46vaf/spacy_249ac8ccd62f47038ca166d14738d25e/setup.cfg -> /private/var/folders/xk/5rw7rdq566x_h9w02mgphnn80000gn/T/pip-install-w8m46vaf/spacy_249ac8ccd62f47038ca166d14738d25e/spacy/tests/package
      Copied /private/var/folders/xk/5rw7rdq566x_h9w02mgphnn80000gn/T/pip-install-w8m46vaf/spacy_249ac8ccd62f47038ca166d14738d25e/pyproject.toml -> /private/var/folders/xk/5rw7rdq566x_h9w02mgphnn80000gn/T/pip-install-w8m46vaf/spacy_249ac8ccd62f47038ca166d14738d25e/spacy/tests/package
      Cythonizing sources
      Compiling spacy/training/example.pyx because it changed.
      Compiling spacy/parts_of_speech.pyx because it changed.
      Compiling spacy/strings.pyx because it changed.
      Compiling spacy/lexeme.pyx because it changed.
      Compiling spacy/vocab.pyx because it changed.
      Compiling spacy/attrs.pyx because it changed.
      Compiling spacy/kb.pyx because it changed.
      Compiling spacy/ml/parser_model.pyx because it changed.
      Compiling spacy/morphology.pyx because it changed.
      Compiling spacy/pipeline/dep_parser.pyx because it changed.
      Compiling spacy/pipeline/morphologizer.pyx because it changed.
      Compiling spacy/pipeline/multitask.pyx because it changed.
      Compiling spacy/pipeline/ner.pyx because it changed.
      Compiling spacy/pipeline/pipe.pyx because it changed.
      Compiling spacy/pipeline/trainable_pipe.pyx because it changed.
      Compiling spacy/pipeline/sentencizer.pyx because it changed.
      Compiling spacy/pipeline/senter.pyx because it changed.
      Compiling spacy/pipeline/tagger.pyx because it changed.
      Compiling spacy/pipeline/transition_parser.pyx because it changed.
      Compiling spacy/pipeline/_parser_internals/arc_eager.pyx because it changed.
      Compiling spacy/pipeline/_parser_internals/ner.pyx because it changed.
      Compiling spacy/pipeline/_parser_internals/nonproj.pyx because it changed.
      Compiling spacy/pipeline/_parser_internals/_state.pyx because it changed.
      Compiling spacy/pipeline/_parser_internals/stateclass.pyx because it changed.
      Compiling spacy/pipeline/_parser_internals/transition_system.pyx because it changed.
      Compiling spacy/pipeline/_parser_internals/_beam_utils.pyx because it changed.
      Compiling spacy/tokenizer.pyx because it changed.
      Compiling spacy/training/align.pyx because it changed.
      Compiling spacy/training/gold_io.pyx because it changed.
      Compiling spacy/tokens/doc.pyx because it changed.
      Compiling spacy/tokens/span.pyx because it changed.
      Compiling spacy/tokens/token.pyx because it changed.
      Compiling spacy/tokens/span_group.pyx because it changed.
      Compiling spacy/tokens/graph.pyx because it changed.
      Compiling spacy/tokens/morphanalysis.pyx because it changed.
      Compiling spacy/tokens/_retokenize.pyx because it changed.
      Compiling spacy/matcher/matcher.pyx because it changed.
      Compiling spacy/matcher/phrasematcher.pyx because it changed.
      Compiling spacy/matcher/dependencymatcher.pyx because it changed.
      Compiling spacy/symbols.pyx because it changed.
      Compiling spacy/vectors.pyx because it changed.
      [ 1/41] Cythonizing spacy/attrs.pyx
      [ 2/41] Cythonizing spacy/kb.pyx
      Traceback (most recent call last):
        File "/Users/maisonsirginou/.pyenv/versions/3.7.17/lib/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/maisonsirginou/.pyenv/versions/3.7.17/lib/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/maisonsirginou/.pyenv/versions/3.7.17/lib/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/xk/5rw7rdq566x_h9w02mgphnn80000gn/T/pip-build-env-cevv5t7x/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/private/var/folders/xk/5rw7rdq566x_h9w02mgphnn80000gn/T/pip-build-env-cevv5t7x/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/xk/5rw7rdq566x_h9w02mgphnn80000gn/T/pip-build-env-cevv5t7x/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 224, in <module>
        File "<string>", line 211, in setup_package
        File "/private/var/folders/xk/5rw7rdq566x_h9w02mgphnn80000gn/T/pip-build-env-cevv5t7x/overlay/lib/python3.7/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
          cythonize_one(*args)
        File "/private/var/folders/xk/5rw7rdq566x_h9w02mgphnn80000gn/T/pip-build-env-cevv5t7x/overlay/lib/python3.7/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: spacy/kb.pyx
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

from cso-classifier.

guoziting112 avatar guoziting112 commented on May 30, 2024

I have the same problem.
Cython.Compiler.Errors.CompileError: spacy/kb.pyx
[end of output]
I am using python =3.8.19 MacOS
@maprann Could you solve this problem?

from cso-classifier.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.