0
閱讀所有關於它的帖子後,我仍然不明白爲什麼我的exe文件不工作.....PY2EXE和硒發行
這是我的「setup.py」:
# -*- coding: cp1252 -*-
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
wd_path = 'C:\\Python27\\Lib\\site-packages\\selenium\\webdriver'
required_data_files = [('selenium/webdriver/firefox',
['{}\\firefox\\x86\\x_ignore_nofocus.so'.format(wd_path), '{}\\firefox\\amd64\\x_ignore_nofocus.so'.format(wd_path)]),('selenium/webdriver/remote',['{}\\remote\\getAttribute.js'.format(wd_path),'{}\\remote\\isDisplayed.js'.format(wd_path)])]
setup(
windows = [{'script': "autovote.py"}],
dll_excludes=['msvcr71.dll', "IPHLPAPI.DLL", "NSI.dll", "WINNSI.DLL", "WTSAPI32.dll"],
data_files = required_data_files,
name = "AutoVote 100% Naruto",
version="1.0",
description = "AutoVote 100% Naruto V1.0 réalisé par GARBEZ François contact:[email protected]",
options = {
"py2exe":{
"bundle_files": 1,
"compressed":1,
}
}
)
這是error.log中:
Traceback (most recent call last):
File "autovote.py", line 4, in <module>
File "zipextimporter.pyc", line 82, in load_module
File "selenium\webdriver\__init__.pyc", line 18, in <module>
File "zipextimporter.pyc", line 82, in load_module
File "selenium\webdriver\firefox\webdriver.pyc", line 34, in <module>
File "zipextimporter.pyc", line 82, in load_module
File "selenium\webdriver\remote\webdriver.pyc", line 25, in <module>
File "zipextimporter.pyc", line 82, in load_module
File "selenium\webdriver\remote\webelement.pyc", line 40, in <module>
File "pkgutil.pyc", line 591, in get_data
IOError: [Errno 2] No such file or directory: 'selenium\\webdriver\\remote\\getAttribute.js'
但我有我的DIST \硒我所有的文件\ webdriver的...至於它編譯時創建...我嘗試過PYInstaller,即人們沒有根本不用工作......我嘗試了幾乎所有相同的主題。 ..Nothing可以解決它TT幫助:)
有人可以向我解釋,請? –