Answer the question
In order to leave comments, you need to log in
How to add phantomJS to .exe via pyinstaller python?
You need to "include" PhantomJs in the .exe file.
I generate through pyinstaller .spec a file for a script.
Then I add Tree('phantomjs\\bin') there
# -*- mode: python -*-
block_cipher = None
a = Analysis(['test_phantom.py'],
pathex=['D:\\python35_64'],
binaries=[],
datas=[],
hiddenimports=['queue'],
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,
Tree('phantomjs\\bin'),
a.zipfiles,
a.datas,
name='test_phantom',
debug=False,
strip=False,
upx=True,
console=True )
browser = webdriver.PhantomJS(('phantomjs\\bin\\phantomjs.exe'))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question