python - Getting py2exe to Include (Selenium) .json Files in .zip -


i have spent day trying solve py2exe not including required selenium files (webdriver.xpi , webdriver_pref.json) in .exe's library.zip or inside .exe seems encountered many people before.

i have researched many similar questions , have tried adapt provided answers no avail (such here , here). have learnt manually transferring files after running py2exe not work suggest some.

my current setup.py looks (although have had many variants similar, none of worked)

from distutils.core import setup import py2exe  wd_base = 'c:\\python34\\lib\\site-packages\\selenium\\webdriver' requireddatafiles = [     ('selenium/webdriver/firefox', ['%s\\firefox\\webdriver.xpi'%(wd_base), '%s\\firefox\\webdriver_prefs.json'%(wd_base)]) ]  setup(     console=['test.py'],     data_files=requireddatafiles,     options={             "py2exe":{                 "skip_archive": true,                 "unbuffered": true,                 "optimize": 2             }         } ) 

and error (either in library.zip or test.exe depending on bundle options..)

exception in tkinter callback traceback (most recent call last):   file "c:\python34\lib\tkinter\__init__.py", line 1533, in __call__     return self.func(*args)   file "test.py", line 177, in sellclick   file "test.py", line 383, in seller   file "c:\python34\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 47, in __init__     self.profile = firefoxprofile()   file "c:\python34\lib\site-packages\selenium\webdriver\firefox\firefox_profile .py", line 63, in __init__     webdriver_preferences)) default_prefs: filenotfounderror: [errno 2] no such file or directory: 'c:\\users\\james\\onedrive\\python\\dist\\library.zip\\selenium\\webdriver\\firefox\\webdriver_prefs.json' 

has found easy solution / workaround tricking py2exe including .xpi , .json files in .zip or .exe? if how implement needed changes?

thanks, j


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -