After updating the Pyinstaller spec file as suggested in the answer here (How to include chromedriver with pyinstaller?), chromedriver is still not being accessed from the generated app file. Could the issue be with .\selenium\webdriver
? That was copied from the answer and I'm not sure it's specific to a Windows OS.
Running the UNIX executable in terminal works, accessing chromedriver.
The full spec file is:
# -*- mode: python -*-
block_cipher = None
a = Analysis([‘scriptname.py'],
pathex=['/Users/Name/Desktop'],
binaries=[('/usr/local/bin/chromedriver', '.\selenium\webdriver')],
datas=None,
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name=‘app name’,
debug=False,
strip=False,
upx=True,
console=False )
app = BUNDLE(exe,
name=‘appname.app',
icon=None,
bundle_identifier=None)
The line pyinstaller appname.spec scriptname.py --windowed --onefile
is used in terminal to generate the app.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…