を参考にし、word2vecをGoogle Colabratoryで動かそうと試みたのですが、
!pip install gensim
!pip install SudachiPy==0.5.4 ginza==4.0.6 ja-ginza==4.0.0 sklearn pandas
の部分でエラーが起きてしまいます。
下はこの部分の実行結果です。原因を調べて、pipやその他のアップグレード等試しましたが、何度やってもこうなってしまいます。
何が原因なんでしょうか?
Requirement already satisfied: gensim in /usr/local/lib/python3.10/dist-packages (4.3.2)
Requirement already satisfied: numpy>=1.18.5 in /usr/local/lib/python3.10/dist-packages (from gensim) (1.23.5)
Requirement already satisfied: scipy>=1.7.0 in /usr/local/lib/python3.10/dist-packages (from gensim) (1.11.3)
Requirement already satisfied: smart-open>=1.8.1 in /usr/local/lib/python3.10/dist-packages (from gensim) (6.4.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Collecting SudachiPy==0.5.4
Using cached SudachiPy-0.5.4.tar.gz (86 kB)
Preparing metadata (setup.py) ... done
Collecting ginza==4.0.6
Using cached ginza-4.0.6.tar.gz (20 kB)
Preparing metadata (setup.py) ... done
Collecting ja-ginza==4.0.0
Using cached ja_ginza-4.0.0.tar.gz (51.5 MB)
Preparing metadata (setup.py) ... done
Collecting sklearn
Using cached sklearn-0.0.post9.tar.gz (3.6 kB)
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Preparing metadata (setup.py) ... error
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.
!pip install ginza ja-ginza
で ginza-5.1.3 がインストールされます。普通に動いてそう。また!pip install gensim
なくてもfrom gensim.models import word2vec
は可能。 なぜ (何の目的で)ginza==4.0.6
などのようにバージョン指定してますか?