pip install pyinstaller
pyinstaller exe.spec
my pyinstaller version is 5.0
When the dll is missing, you can directly copy the library in the current environment to the dist folder.
When the module is not found, you can manually add the module in hiddenimports.