When converting a python script using Selenium WebDriver to an executable file (exe) with pyinstaller, the executable file does not include WebDriver by default, so use the --add-binary option and use the following command. You need to run.
pyinstaller ./main.py --onefile --noconsole --add-binary "Original file path;Import file path"
However, if you execute the above in a Unix environment (including MacOSX), the following error message may be output and you may not be able to execute it.
pyinstaller: error: argument --add-binary: invalid add_data_or_binary value: 'Original file path;Import file path'
When I looked it up on the following site, it seems OK if I replace the semicolon (;) in the path specified by --add-binary with a colon (:). I tried it and it worked. https://github.com/pyinstaller/pyinstaller/issues/3968
pyinstaller ./main.py --onefile --noconsole --add-binary "Original file path:Import file path"
I encountered this event while running in a Mac OS X environment. I had a lot of trouble solving it, so I hope it helps those who are suffering from the same phenomenon.