No Module Named 'apscheduler' Error When Running the .exe file. --hidden-file command Doesn't Work

Viewed 112

I've recently created an .exe file of my program with pyinstaller using this code:

pyinstaller --onefile 'myprogram.py'

This worked for some other programs but when I ran this .exe file

Traceback (most recent call last): File "myprogram.py", line 3, in ModuleNotFoundError: No module named 'apscheduler' [18908] Failed to execute script myprogram

When searching through internet, I found hidden import command and tried it using this code but it gave the same error message:

pyinstaller --onefile --hidden-import=apscheduler 'myprogram.py'

I don't know if it's related to the problem but I think it's worth noting that the import command of APscheduler looks like this:

from apscheduler.schedulers.blocking import BlockingScheduler

Is there anyway I can fix this issue quickly? Pyinstaller version:4.3 Apscheduler version: 3.7.0

0 Answers
Related