こんなのが表示されて、Nix?へMigrationされた。
新規プロジェクトだと、Terminalだとダメで、ShellだとPoetry動いたのでMigrateされたプロジェクトでやってみるがダメ。
poetry install
とかpoetry系のコマンドを実行すると、
以下のように、「idnaなんてモジュール見つからないよ?」とエラーになる。
$ ./start.sh Traceback (most recent call last): File "/home/runner/discord-xxxxxxx/venv/bin/poetry", line 5, in <module> from poetry.console import main File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/__init__.py", line 1, in <module> from .application import Application File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/application.py", line 7, in <module> from .commands.about import AboutCommand File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/commands/__init__.py", line 4, in <module> from .check import CheckCommand File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/commands/check.py", line 2, in <module> from poetry.factory import Factory File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/factory.py", line 16, in <module> from .packages.locker import Locker File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/packages/__init__.py", line 2, in <module> from .locker import Locker File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/packages/locker.py", line 38, in <module> from poetry.utils.extras import get_extra_package_names File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/utils/extras.py", line 7, in <module> from poetry.utils.helpers import canonicalize_name File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/utils/helpers.py", line 11, in <module> import requests File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/requests/__init__.py", line 147, in <module> from . import packages, utils File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/requests/packages.py", line 16, in <module> locals()[package] = __import__(package) ModuleNotFoundError: No module named 'idna' Traceback (most recent call last): File "/home/runner/discord-xxxxxxx/venv/bin/poetry", line 5, in <module> from poetry.console import main File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/__init__.py", line 1, in <module> from .application import Application File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/application.py", line 7, in <module> from .commands.about import AboutCommand File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/commands/__init__.py", line 4, in <module> from .check import CheckCommand File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/commands/check.py", line 2, in <module> from poetry.factory import Factory File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/factory.py", line 16, in <module> from .packages.locker import Locker File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/packages/__init__.py", line 2, in <module> from .locker import Locker File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/packages/locker.py", line 38, in <module> from poetry.utils.extras import get_extra_package_names File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/utils/extras.py", line 7, in <module> from poetry.utils.helpers import canonicalize_name File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/utils/helpers.py", line 11, in <module> import requests File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/requests/__init__.py", line 147, in <module> from . import packages, utils File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/requests/packages.py", line 16, in <module> locals()[package] = __import__(package) ModuleNotFoundError: No module named 'idna' exit status 1
redditでも同じ事象のスレッドがあったけど、なんか誰も興味なさそう。 www.reddit.com
pip install
で地道にモジュールをインストールしていったら動いたけど、これ、なんなんだろう。
Nixになったから説明書読んでおけよ、みたいな雰囲気があったのにスルーしたのが悪かったのかな....。
最近あんまりrepl.itを使わなくなったから別にいいのだけど、他の人たちは困ってないのかなぁと疑問に思う。
解決編
と思っていたが、新規プロジェクトだとpoetryが普通に動いた。 そこで、poetryが使えない&poetry.lockが初期化?的な感じになっていることに気づいた。
試しに、以下のようにやっていくと普通にBotが動いた。
Migrationしてくれるのは嬉しいけど、poetry.lock
ごと移行してくれたらよかったのに。
もしくは、ちゃんとpoetry.lock
が消えてますぞ、と伝えてくれるか(英語でなんか言ってたのかもしれない...)。
pip install poetry poetry add discord-py-slash-command=1.2.0 discord.py==1.6.0 flask python-dotenv python-dateutil pycryptodome
*これは古いやつを動かしたいので、古めのやつをインストールしてる...。良い子は真似しないで