jianlins / PyRuSH

init

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incompatible with Python 3.10?

kimberlymcm opened this issue · comments

I'm excited to try out this package, but I'm getting the below error when I pip install on Python 3.10.6. It seems similar, but slightly different, to the error in the other open ticket. Thoughts?

`Collecting PyRuSH
Using cached PyRuSH-1.0.6.tar.gz (44 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/private/var/folders/1y/wjywcxvj4k9_6f3dgf1z0k_m0000gn/T/pip-install-wcgsx90f/pyrush_70b2b2ac1dc347a083da8543d1e88a2d/setup.py", line 72, in
ext_modules=cythonize(extensions, compiler_directives=COMPILER_DIRECTIVES),
File "/Users/kimberlymcmanus/Documents/life/NLP/venv/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 970, in cythonize
module_list, module_metadata = create_extension_list(
File "/Users/kimberlymcmanus/Documents/life/NLP/venv/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 816, in create_extension_list
for file in nonempty(sorted(extended_iglob(filepattern)), "'%s' doesn't match any files" % filepattern):
File "/Users/kimberlymcmanus/Documents/life/NLP/venv/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 114, in nonempty
raise ValueError(error_msg)
ValueError: 'PyRuSH/StaticSentencizerFun.pyx' doesn't match any files
[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.
`

I am running into a similar error:

Collecting PyRuSH>=1.0.6
  Using cached PyRuSH-1.0.6.tar.gz (44 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/qz/tt8wl6hn2cs6rw77r5mcmll00000gp/T/pip-install-2726aupm/pyrush_52c6880527564118b34d4814981d67c5/setup.py", line 72, in <module>
          ext_modules=cythonize(extensions, compiler_directives=COMPILER_DIRECTIVES),
        File "/Users/dlituiev/Library/r-miniconda-arm64/envs/clinspacy/lib/python3.8/site-packages/Cython/Build/Dependencies.py", line 970, in cythonize
          module_list, module_metadata = create_extension_list(
        File "/Users/dlituiev/Library/r-miniconda-arm64/envs/clinspacy/lib/python3.8/site-packages/Cython/Build/Dependencies.py", line 816, in create_extension_list
          for file in nonempty(sorted(extended_iglob(filepattern)), "'%s' doesn't match any files" % filepattern):
        File "/Users/dlituiev/Library/r-miniconda-arm64/envs/clinspacy/lib/python3.8/site-packages/Cython/Build/Dependencies.py", line 114, in nonempty
          raise ValueError(error_msg)
      ValueError: 'PyRuSH/StaticSentencizerFun.pyx' doesn't match any files
      [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.

Versions

Python 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:05:16)
[Clang 12.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.

pip freeze | grep Cython
Cython==0.29.32

I was able to fix it by installing from master:

pip install git+https://github.com/jianlins/PyRuSH.git@master

However, for version control, I need a tag PyRuSH>=1.0.6, which is not in the repository.
Would it be possible to create a tag for the latest stable version?

I got past this error by cloning the PyRush repo and running setup.py from it. I then did the same with the quicksect repo. Those seems to work, but now I am stuck on the below error due to the ml chip.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/kimberlymcmanus/Documents/life/NLP/venv/lib/python3.10/site-packages/medspacy/__init__.py", line 1, in <module>
    from . import components
  File "/Users/kimberlymcmanus/Documents/life/NLP/venv/lib/python3.10/site-packages/medspacy/components.py", line 12, in <module>
    from .sentence_splitting import PyRuSHSentencizer
  File "/Users/kimberlymcmanus/Documents/life/NLP/venv/lib/python3.10/site-packages/medspacy/sentence_splitting.py", line 2, in <module>
    from PyRuSH import PyRuSHSentencizer
  File "/Users/kimberlymcmanus/Documents/life/NLP/venv/lib/python3.10/site-packages/PyRuSH-1.0.6-py3.10-macosx-12-arm64.egg/PyRuSH/__init__.py", line 31, in <module>
    from .PyRuSHSentencizer import PyRuSHSentencizer
  File "/Users/kimberlymcmanus/Documents/life/NLP/venv/lib/python3.10/site-packages/PyRuSH-1.0.6-py3.10-macosx-12-arm64.egg/PyRuSH/PyRuSHSentencizer.py", line 21, in <module>
    from .RuSH import RuSH
  File "/Users/kimberlymcmanus/Documents/life/NLP/venv/lib/python3.10/site-packages/PyRuSH-1.0.6-py3.10-macosx-12-arm64.egg/PyRuSH/RuSH.py", line 35, in <module>
    from PyFastNER import FastCNER
  File "/Users/kimberlymcmanus/Documents/life/NLP/PyRuSH/.eggs/PyFastNER-1.0.8-py3.10.egg/PyFastNER/__init__.py", line 1, in <module>
    from .FastCNER import FastCNER
  File "/Users/kimberlymcmanus/Documents/life/NLP/PyRuSH/.eggs/PyFastNER-1.0.8-py3.10.egg/PyFastNER/FastCNER.py", line 20, in <module>
    from quicksectx import IntervalTree, Interval
  File "/Users/kimberlymcmanus/Documents/life/NLP/venv/lib/python3.10/site-packages/quicksectx-0.3.1-py3.10-macosx-12-arm64.egg/quicksectx/__init__.py", line 2, in <module>
    from .quicksectx import Interval, IntervalNode, IntervalTree, distancex
ImportError: dlopen(/Users/kimberlymcmanus/Documents/life/NLP/venv/lib/python3.10/site-packages/quicksectx-0.3.1-py3.10-macosx-12-arm64.egg/quicksectx/quicksectx.cpython-310-darwin.so, 0x0002): tried: '/Users/kimberlymcmanus/Documents/life/NLP/venv/lib/python3.10/site-packages/quicksectx-0.3.1-py3.10-macosx-12-arm64.egg/quicksectx/quicksectx.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/quicksectx.cpython-310-darwin.so' (no such file), '/usr/lib/quicksectx.cpython-310-darwin.so' (no such file)

@kimberlymcm you might need to find out whether your python is running on 'x86_64' or 'arm64e'. It sounds like the former.

This may do the job:

which python
python -c 'import platform; print(platform.platform())'

There is a packaging configuration error. Working on it now. In the meantime, you could use:
pip install git+https://github.com/jianlins/PyRuSH

It's fixed. Thanks