An application created using Pyinstaller does not bind to the specified binary (chromedriver)

After updating the Pyinstaller specification file, as suggested in the answer here ( How to enable chromedriver with pyinstaller? ), Chromedriver is still not accessible from the generated application file, Could there be a problem with .\\selenium\\webdriver? This was copied from the answer, and I'm not sure if this is specific to Windows.

Running a UNIX executable in a terminal works by accessing chrome.

Full specification file:

# -*- 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 string is pyinstaller appname.spec scriptname.py --windowed --onefileused in the terminal to create the application.

+1
source share
1

, Windows. Unix ./selenium/webdriver. , , pyinstall, chromedriver /path/to/bundle/dist/selenium/webdriver.
- , ( ):

dir = os.path.dirname(__file__)
chrome_path = os.path.join(dir, selenium','webdriver','chromedriver.exe')
service = service.Service(chrome_path) ... 
+1

Source: https://habr.com/ru/post/1655010/


All Articles