简体   繁体   中英

cx_freeze + selenium + python 3 : No module named 'httplib'

Im trying to buld my app with selenium, i have this setup.py:

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]
)

The build finish with no problems, but when i run my application:

ImportError: No module named 'httplib'

My configuration: Python 3.4.3 32bit. PyQt5 Selenium 2.46.0

Thaks for the help

httplib either isn't in your directory path or hasn't been imported.

try adding either of these two scripts to your code:

  1. import httplib
  2. httplib = httplib(config_file="your directory path to httplib")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM