I'm trying to create an executable file using Py2Exe
. If I use PhantomJS Selenium webdriver
instead of Firefox
, everything works fine. The problem is when I try to use Firefox webdriver
.
It raises this exception (when executing exe file):
Traceback (most recent call last):
File "main.py", line 218, in <module>
File "main.py", line 113, in __init__
File "selenium\webdriver\firefox\webdriver.pyc", line 48, in __init__
File "selenium\webdriver\firefox\firefox_profile.pyc", line 65, in __init__
IOError: [Errno 2] No such file or directory: 'C:\\Users\\Milano\\PycharmProject
s\\Velvet\\WebDbUploader\\dist\\library.zip\\selenium\\webdriver\\firefox\\webdr
iver_prefs.json'
So I've found inside site-packages...selenium..firefox
the webdriver_prefs.json
and copied it into the ..WebDbUploader\dist\library.zip\selenium\webdriver\firefox
and no change... still the same error occures.
Now, I've solved this. I just unzip library.zip
, copy those files inside it and zip it again. But now, there is a new error which says that it can't import os
module which is weird since there is no problem with this import when I use PhantomJS
.
Is there some way to repair this? Maybe use just not zipped library or something like that?