I've started taking a multi-language course in meantime and now I'm practicing Python with beginner projects. I've made a small desktop notifier project and I want to make an .exe out of it. I use Anaconda3 and I write codes in Spyder4.
When I try to make an exe out of it, no matter what I try, it doesn't compile an .exe file, some error happens mid-compilation and it stops. Build folder and .spec file are okay, but dist folder remains empty.
Here's the code of the application I wrote:
import time
from win10toast import ToastNotifier
notTime = input("Enter the desired time of notification (HH:MM:SS, 24-hr): ")
notMsg = input("Enter your message: ")
while True:
timeCur = time.strftime("%H:%M:%S")
if timeCur == notTime:
print(timeCur)
break
notify = ToastNotifier()
notify.show_toast("Notification",notMsg)
The compile log shows two important errors, first one: Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
- The Python version is: Python3.8 from "c:\users\kuzgu\anaconda3\python.exe"
- The NumPy version is: "1.20.1"
and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help.
Original error was: DLL load failed while importing _multiarray_umath
And the second one:
AssertionError: Failed to determine matplotlib's data directory!
To add some salt to the wound, PyInstaller itself actually works with more basic scripts that doesn't import anything, like the demos I've made during Python part of the course. The win10toast part makes the problem as I suppose, but I'm not sure.
How can I fix this problem?