tokuhirom's Blog

python の romkan がインストールできない

Collecting romkan
  Using cached romkan-0.2.1.tar.gz (10 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 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/kg/nqb8t2f1253_kh0r_rl06pcm0000gq/T/pip-install-cmsaoeh6/romkan_3dc774240ae4470fa4013b902bdab42c/setup.py", line 8, in <module>
          import os, json, imp
      ModuleNotFoundError: No module named 'imp'
      [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.

となって悲しい。

https://github.com/soimort/python-romkan/issues/17

https://docs.python.org/3.11/library/imp.html

imp というモジュールが、python 3.12で消えたようだ。

romkan に関して言うと、そんなに大きいライブラリではないのでコピペして使うのが良いかもしれず。。