I am trying to use Pyinstaller to make my .py to .exe.
I used >> pyinstaller --onefile -w main.py to generate files and an exe.
But when I tried to run it by terminal in PyCharm, these error comes out:
Traceback (most recent call last):
File "main.py", line 1, in <module>
import Setting
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "Setting.py", line 1, in <module>
import pygame
ModuleNotFoundError: No module named 'pygame'
[5458] Failed to execute script main
I have added 'pygame' inside hiddenimports and the absolute path of pygame folder(something like '....../venv/lib/python3.7/site-packages/pygame/') inside pathex in my main.spec.
These are the solutions that I can find from google but it doesn't work. Same error just comes out again :(
I've tried import Pygame in just Hello World but still having error.