What to do when pyinstaller: error: argument --add-binary: invalid add_data_or_binary value: appears

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.

Recommended Posts

What to do when pyinstaller: error: argument --add-binary: invalid add_data_or_binary value: appears
What to do when "Invalid HTTP_HOST header" appears in Django
[Docker] What to do when error Couldn't find the binary git appears
[Go 1.13] What to do when unexpected directory layout: appears
[openpyxl] What to do when IllegalCharacterError appears in pandas.DataFrame.to_excel
curl: (60) What to do when Issuer certificate is invalid.
[Python] What to do when No module named'pyproj.datadir' appears when Exe is done with PyInstaller
What to do when "Type Error: must be _socket.socket, not socket" appears on GAE
What to do when a Remove Error occurs when updating conda
What to do when an error occurs with import _ssl
What to do when "SSL: CERTIFICATE_VERIFY_FAILED _ssl.c: 1056" appears in Python
OSError: [Errno 40] What to do when Message too long appears
What to do when Ubuntu crashes
[Beanstalk] What to do when an error occurs with import uuid
What to do if Insecure Platform Warning appears when running Python
What to do when the value type is ambiguous in Python?
[Memorandum] What to do when a warning appears after executing pip list
[Python] What to do when an error related to SSL authentication is returned
What to do if an error occurs when importing numpy with VScode
What to do if you get an error when trying to load mnist
What to do when the warning "The environment is in consistent ..." appears in the Anaconda environment
What to do if you get an error when installing Dlib (Ubuntu)
[OSX] [pyenv] What to do when an SSL error occurs in pip
What to do when psycopg2 throws an error when pipenv lock under Pipenv environment
What to do when "OS Error: [WinError 126] The specified module cannot be found" appears in import torch
[Python] What to do if an error occurs in pip (pyinstaller, pyautogui, etc.)
[python] What to do when an error occurs in send_keys of headless chrome
What to do when "TypeError: must be string, not int…" appears when using strptime
What to do when SSL error occurs in pip in Windows10, miniconda, VScode environment
What to do when a warning appears around Python integration in Neovim's CheckHealth
What to do when "TypeError: data type not understood" appears in python's numpy.zeros
What to do if you get an error when installing python with pyenv
What to do when PermissionError of tempfile.mkstemp occurs
What to do when [Errno 2] No such file or directory appears in Python
[Python] Type Error:'WebElement' object is not iterable What to do when an error occurs
What to do if you get an OpenSSL error when installing Python 2 with pyenv
What to do if you get a memory error when converting from PySparkDataFrame to PandasDataFrame
What to do if you get an error when importing matplotlib in Python (Mac)
What to do if you get an Import Error when importing matplotlib with Jupyter
What to do if you get the error ʻERR_FEATURE_UNAVAILABLE_ON_PLATFORM` when using ts-node-dev on Linux
What to do when gdal_merge creates a huge file
What to do when raise ValueError, "unsupported hash type"
What to do when "cannot import name xxx" [Python]
What to do when you can't bind CaboCha to Python
What to do when you get an error saying "Name resolution temporarily failed" on linux
What to do if you get an error when running "certbot renew" in CakePHP environment
What to do if you get an Undefined error when trying to use pip with pyenv
[AWS] What to do when you want to pip with Lambda
What to do when Japanese is not displayed on matplotlib
What to do when PyCharm font is strange or garbled
What to do when Unalignable boolean Series provided as indexer
What to do if a 0xC0000005 error occurs in tf.train.start_queue_runners ()
What to do if package installation fails when deploying to heroku
ImportError: No module What to do when you are told
[virtualbox] What to do when [Could not retrieve mirrorlist] appears when yum update is performed on CentOS7
What to do if you get a must override `get_config` error when trying to model.save in Keras
[AWS] What to do when the ping command causes a "timeout"
TypeError: __init__ () got an unexpected keyword argument What to do with'status'
What to do when a video cannot be read by cv2.VideoCapture
What to do when the jupyterlab extension settings are not reflected
"Value Error: Unable to configure handler'file_output_handler'" when starting a python program