【发布时间】:2016-04-15 16:36:18
【问题描述】:
我有一个 selenium python 2.7 应用程序,可以搜索不同网站上的航班。我使用 cx_freeze 创建了一个可执行文件,它在 Windows 7 上完美运行,但在 Windows 10 上出现此错误。
这是我的 setup.py:
import sys
import os
from cx_Freeze import setup, Executable
exe = Executable(
script=r"selenium_start.py",
base="Win32GUI",
appendScriptToExe = True,
appendScriptToLibrary = True,
)
setup(
name = "GoPepper Search Tool",
version = "0.1",
description = "GoPepper Search Tool",
options = {"build_exe": {"create_shared_zip": True,"append_script_to_exe": True, "packages": ["selenium"]} },
executables = [exe]
)
这就是我创建可执行文件后的文件夹结构。 webdriver json文件有问题,但我在这里找到了一个解决方案,将整个selenium文件夹复制到带有.exe的文件夹中(我不知道这是否会导致Windows 10出现问题)。
windows 10的笔记本是全新的,没有安装python等,会不会是这个问题?但实际上一个exe必须在没有任何东西的情况下工作?谢谢!
【问题讨论】:
标签: python windows python-2.7 selenium cx-freeze