No module named 'torch' when I make exe file using pyinstaller

[Environment]

  • vscode
  • Anaconda

when I make exe file using pyinstaller, I have the below error message even if I successfully ran main_for_exe.py.

There are some solutions: "add module to hiddenimports
but, it does not work.

How do I solve this???

I haven’t used pyinstaller but I figure it needs some link to a requirements.txt or a link to the pytorch source code