2

I'm trying to create an exe file using Py2Exe. For debugging purposes, there is an option to use Firefox webdriver instead of PhantomJS which is headless and one phantomjs.exe file inside the main directory is enough.

Ok so everything fine, but when I create an exe file:

from distutils.core import setup
import py2exe

setup(console=["main.py"])

The program raises:

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'

Do you have any idea what to do?

IMPORTANT EDIT:

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.

Milano
  • 18,048
  • 37
  • 153
  • 353

1 Answers1

0

You could try to copy webdriver_prefs.json and webdriver.xpi and from C:\Python34\Lib\site-packages\selenium\webdriver\firefox to dist\selenium\webdriver\firefox. It should be enough.

For more details you can refer to this answer.

Community
  • 1
  • 1
mabe02
  • 2,676
  • 2
  • 20
  • 35