0
我試着去球泡我與硒的應用程序,我有這個setup.py:cx_freeze +硒+蟒蛇3:無模塊名爲「httplib的」
import sys
from cx_Freeze import setup, Executable
path_drivers = ("C:\Python34\Lib\site-packages\PyQt5\plugins\sqldrivers\qsqlmysql.dll", "sqldrivers\qsqlmysql.dll")
includes = ["atexit","PyQt5.QtCore","PyQt5.QtGui", "PyQt5.QtWidgets","PyQt5.QtSql", "selenium"]
includefiles = [path_drivers]
excludes = [
'_gtkagg', '_tkagg', 'bsddb', 'curses', 'email', 'pywin.debugger',
'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',
'Tkconstants', 'Tkinter'
]
packages = ["os"]
path = []
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {
"includes": includes,
"include_files": includefiles,
"excludes": excludes,
"packages": packages,
"path": path
}
# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
exe = None
if sys.platform == "win32":
exe = Executable(
script="main.py",
initScript = None,
base=None,
targetName="zeus.exe",
compress = True,
copyDependentFiles = True,
appendScriptToExe = False,
appendScriptToLibrary = False,
icon = None
)
setup(
name = "telll",
version = "0.1",
author = 'me',
description = "My GUI application!",
options = {"build_exe": build_exe_options},
executables = [exe]
)
構建完成,沒有任何問題,但是當我運行我的應用程序:
ImportError: No module named 'httplib'
我的配置: 的Python 3.4.3 32位。 PyQt5 硒2.46.0
Thaks的幫助
嘗試增加httplib的到'packages'列表在你的setup.py –
@ThomasK httplib是一個來自python2的庫,我使用python3,因爲PyQt5使用python3,但是硒需要httplib。我不知道如何解決這個問題,當我運行我的應用程序表單控制檯永恆的工作完美。 –
是否有跟蹤錯誤信息?如果是這樣,你能證明嗎? –