0

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

Thomas K
  • 39,200
  • 7
  • 84
  • 86
  • Try adding httplib to the 'packages' list in your setup.py – Thomas K Jul 12 '15 at 16:39
  • @ThomasK httplib is a library from python2 and i'm using python3 because PyQt5 use python3, but selenium require httplib. I don't know how to fix this, when i run my application form console everithing work perfect. – Víctor Villalobos Jul 13 '15 at 14:15
  • Is there a traceback with the error message? If so, can you show that too? – Thomas K Jul 14 '15 at 16:29

1 Answers1

0

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")
Gus Gabel
  • 147
  • 2
  • 2
  • 9
  • the problem arises because python3 selenium used httplib2 but for some reason requires httplib but works perfectly in python3. Yet when creating the build with cx_Freeze matter is httplib I do not know how to fix this and end the deploy of the application. – Víctor Villalobos Jul 13 '15 at 14:14