Bar Bar - 1 year ago 165
Python Question

Export Python to exe with "py2exe", Selenium error

i am trying to export Python app With GUI & Selenium, using "py2exe" :

from distutils.core import setup
import py2exe

data_files = [('selenium\\webdriver\\firefox', ['C:\Python34\Lib\site-packages\selenium-2.44.0-py3.4.egg\selenium\webdriver\\firefox\webdriver.xpi']),
('selenium\\webdriver\\firefox', ['C:\Python34\Lib\site-packages\selenium-2.44.0-py3.4.egg\selenium\webdriver\\firefox\webdriver_prefs.json'])]

console = {''}, requires=['easygui', 'selenium'],


i get a error -

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Python34\dist\lib\selenium\webdriver\firefox\webdriver_prefs.json'

i try to add the files manually to the zip, did not work.

any suggestions ?

Answer Source

You need to configure file:

A file can be added in a project to define the list of files to include in the distribution built by the sdist command.

For example, you can include all .json files to the build:

recursive-include *.json

Also see: