Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install hanlp failed #1849

Closed
1 task done
neoedmund opened this issue Oct 12, 2023 · 4 comments
Closed
1 task done

pip install hanlp failed #1849

neoedmund opened this issue Oct 12, 2023 · 4 comments
Assignees
Labels

Comments

@neoedmund
Copy link

Describe the bug
pip install hanlp failed

Code to reproduce the issue

pipx install hanlp  

Describe the current behavior

Fatal error from pip prevented installation. Full pip output in file:
    /home/neoe/.local/pipx/logs/cmd_2023-10-12_20.44.33_pip_errors.log

pip failed to build package:
    tokenizers

Some possibly relevant errors from pip install:
    error: subprocess-exited-with-error
    error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
    error: could not compile `tokenizers` (lib) due to previous error; 3 warnings emitted
    error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib --` failed with code 101

Error installing hanlp.

Expected behavior
install ok

System information

  • debian 12
  • Python version: Python 3.11.2
  • HanLP version: newest

Other info / logs

  • I've completed this form and searched the web for solutions.
@neoedmund
Copy link
Author

the rustc is current, so I guess the tokenizers is too old to pass the new rustc

@hankcs
Copy link
Owner

hankcs commented Oct 13, 2023

Hi, you could be right, the tokenizers version is pinned here: https://github.com/hankcs/HanLP/blob/doc-zh/setup.py#L64

However, even the lastest tokenizers doesn't release a Python3.11 wheel, indicating that there could be some issues with py3.11 compilation.

Also, HanLP doesn't claim support for Python3.11 so it's not a bug: https://github.com/hankcs/HanLP/blob/doc-zh/setup.py#L52 You can clone a copy and unpin the version by yourself.

To support 3.11, the latest tokenizers would force us to drop support for py3.6. Considering the popularity of py3.6, this is not a wise choice.

@hankcs hankcs added invalid and removed bug labels Oct 13, 2023
@neoedmund
Copy link
Author

Thank you. I will try new version of tokenizers later. maybe rustc version related than python version.

@hankcs hankcs closed this as completed Oct 13, 2023
@neoedmund
Copy link
Author

I realized I install from pip not source, so maybe I cannot unpin anything. what the economics of rust is like, I just have a taste of it.

hankcs pushed a commit that referenced this issue Oct 14, 2023
hankcs pushed a commit that referenced this issue Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants