I created app to just open browser like following code and it works fine from cmd line.
But, when I packaged it by pyinstaller, it doesn't work..
What's the problem? I will appreciate your help with this situation.
# main.py
# -*- coding: utf-8 -*-
import os
from selenium import webdriver
if __name__ == '__main__':
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
DRIVER_BIN = os.path.join(PROJECT_ROOT, "chromedriver")
browser = webdriver.Chrome(executable_path=DRIVER_BIN)
browser.get('https://google.com/')
This is .spec file.
# -*- mode: python -*-
import os
project_path = os.path.abspath(os.path.curdir)
block_cipher = None
a = Analysis(['main.py'],
pathex=[project_path],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='test',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=False)
app = BUNDLE(exe,
name='test.app',
icon=None,
bundle_identifier=None)
And file tree is like these.
dist/
test.app
test
chromedriver <- add after packaged
error is maybe this.
Jun 26 14:42:01 MacBookPro ctkahp[67399]: objc[67399]: Class TKTokenRefCtkd is implemented in both /System/Library/Frameworks/Security.framework/Versions/A/Sec urity (0x7fff8a3cf0a0) and /System/Library/Frameworks/CryptoTokenKit.framework/ctkahp.bundle/Contents/MacOS/ctkahp (0x10ecbc760). One of the two will be used. Which one is undefined.
Jun 26 14:42:16 MacBookPro com.apple.xpc.launchd[1] (highlow.23356[67408]): Service exited with abnormal code: 255