sentencepiece icon indicating copy to clipboard operation
sentencepiece copied to clipboard

Doesn't seem to work with Python 3.13

Open tprrt opened this issue 2 years ago • 12 comments

The following issue occurs with Python 3.13, but no issues occur with Python 3.11:

>>> import sentencepiece as spm
Traceback (most recent call last):
  File '<stdin>', line 1, in <module>
    import sentencepiece as spm
  File '/usr/lib/python3.13/site-packages/sentencepiece/__init__.py', line 10, in <module>
    from . import _sentencepiece
ImportError: cannot import name '_sentencepiece' from partially initialized module 'sentencepiece' (most likely due to a circular import) (/usr/lib/python3.13/site-packages/sentencepiece/__init__.py)
>>> exit()

tprrt avatar Nov 20 '24 07:11 tprrt

rip sentencepiece

Kreijstal avatar Dec 07 '24 19:12 Kreijstal

@taku910 Are you planning to release wheels for Python 3.13 and can we support you somehow?

severinsimmler avatar Dec 12 '24 08:12 severinsimmler

not work in py3.13 when to fix this issue?thank you

yuedu88 avatar Jan 09 '25 18:01 yuedu88

Okay, who is forking it, where is the repo, who is the new juicy mantainer? we have a repo... to mantain

Kreijstal avatar Jan 09 '25 19:01 Kreijstal

You can install sentencepiece (tested to pass the test suite) for python 3.9-3.13 from conda-forge:

conda install -c conda-forge sentencepiece

(you can also use the compatible mamba installer or the next-gen pixi instead of conda)

h-vetinari avatar Jan 10 '25 13:01 h-vetinari

not work for python 3.13 please we need support

arabyserv avatar Jan 26 '25 00:01 arabyserv

i had issue installing sentencepiece on python 3.13.1 because of build wheels but conda-forge worked for me

dsnehitha avatar Feb 05 '25 22:02 dsnehitha

You can install sentencepiece (tested to pass the test suite) for python 3.9-3.13 from conda-forge:

conda install -c conda-forge sentencepiece

(you can also use the compatible mamba installer or the next-gen pixi instead of conda) I don't know where to run”conda install -c conda-forge sentencepiece”.

Sdreamtale avatar Feb 17 '25 08:02 Sdreamtale

I don't know where to run ”conda install -c conda-forge sentencepiece”.

Well, you need to install the tool called conda first (for example from here; or one of the equivalent tools that I mentioned, which also follow the same paradigm: mamba or pixi), then you can install packages from conda-forge. Here's a little primer on using mamba, for example

h-vetinari avatar Feb 17 '25 08:02 h-vetinari

Using conda isn't an option for PyTorch+ROCm. We need default python 3.13 compatibility without having to jump through so many hoops.

Image

ricperry avatar Mar 02 '25 22:03 ricperry

Using conda isn't an option for PyTorch+ROCm.

You can pip install things into a conda-environment (e.g. install pytorch+ROCM into an env which contains sentencepiece). For rocm support, we'd like to provide that, feel free to help push https://github.com/conda-forge/conda-forge.github.io/issues/1923 forward.

h-vetinari avatar Mar 03 '25 01:03 h-vetinari

In few months Python 3.14 will be released and here it doesn't even work on 3.13 yet.

tousif47 avatar Mar 13 '25 18:03 tousif47