It should be added as a binary file, since it is a binary file ...
Thus, a special specification file is required, in which the chrome transmission path in the local system and the desired location relative to dist \ myscript must be defined, so it looks something like this:
.....
a = Analysis(['myscript.py'],
pathex=['path\\to\\my\\script'],
binaries=[ ('path\\to\\my\\chromedriver.exe', '.\\selenium\\webdriver') ],
datas=None,
....
And then run pyinstaller with this specification file: pyinstaller myscript.spec myscript.py
source
share