SamuraiT / mecab-python3

:snake: mecab-python. you can find original version here:http://taku910.github.io/mecab/
https://pypi.python.org/pypi/mecab-python3
Other
541 stars 51 forks source link

Wheels for Python 3.12 #100

Closed 28140 closed 7 months ago

28140 commented 12 months ago

Please add support for Python 3.12, if you can, please...

% pip install mecab-python3
Collecting mecab-python3
  Downloading mecab-python3-1.0.8.tar.gz (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.5/78.5 kB 1.1 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: mecab-python3
  Building wheel for mecab-python3 (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for mecab-python3 (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [11 lines of output]
      WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-14-x86_64-cpython-312
      creating build/lib.macosx-14-x86_64-cpython-312/MeCab
      copying src/MeCab/__init__.py -> build/lib.macosx-14-x86_64-cpython-312/MeCab
      copying src/MeCab/cli.py -> build/lib.macosx-14-x86_64-cpython-312/MeCab
      running build_ext
      error: [Errno 2] No such file or directory: 'mecab-config'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for mecab-python3
Failed to build mecab-python3
ERROR: Could not build wheels for mecab-python3, which is required to install pyproject.toml-based projects

Thank you!

polm commented 11 months ago

This should already work with 3.12 if you install MeCab first. I'll work on making wheels.

polm commented 11 months ago

You should be able to install 3.12 wheels shortly using pip install mecab-python3==1.0.9dev3. If I can get confirmation this works I'll make a proper release.

tueda commented 11 months ago

I do not see any Linux/macOS wheels for 3.12 in 1.0.9.dev3 ...

Indeed, pip install mecab-python3==1.0.9dev3 on Ubuntu fails as

Collecting mecab-python3==1.0.9dev3
  Using cached mecab-python3-1.0.9.dev3.tar.gz (78 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: mecab-python3
  Building wheel for mecab-python3 (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for mecab-python3 (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [11 lines of output]
      WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-312
      creating build/lib.linux-x86_64-cpython-312/MeCab
      copying src/MeCab/__init__.py -> build/lib.linux-x86_64-cpython-312/MeCab
      copying src/MeCab/cli.py -> build/lib.linux-x86_64-cpython-312/MeCab
      running build_ext
      error: [Errno 2] No such file or directory: 'mecab-config'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for mecab-python3
Failed to build mecab-python3
ERROR: Could not build wheels for mecab-python3, which is required to install pyproject.toml-based projects

Environment:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy
$ python --version
Python 3.12.1
$ pip --version
pip 23.3.1 from /home/**********/.venv/lib/python3.12/site-packages/pip (python 3.12)
polm commented 11 months ago

Thanks for checking. It seems that the way the version range was specified didn't work, I'll give it another go.

polm commented 11 months ago

OK, figured it out and 1.0.9dev4 should be up with wheels shortly.

tueda commented 11 months ago

pip install mecab-python3==1.0.9dev4 works for me (python 3.12.1, Ubuntu 20.04.6, x86_64), but I doubt it on macOS because no macOS wheels in 1.0.9.dev4, though.

NhutTien0905 commented 11 months ago

i tried but it not work for me

polm commented 8 months ago

I have tried adding 3.12 to the config for the wheels, but for some reason it doesn't seem to be working for OSX, even though the logs make it clear it's installed. I will get around to fixing it eventually, but if anyone wants to contribute a fix that'd be a big help.

polm commented 7 months ago

I have just released v1.0.9, which should resolve this. The issue with OSX specifically was with the version of cibuildwheel, see https://github.com/polm/fugashi/pull/91 for details.

Apologies it took so long to resolve this.