编译时cx_Freeze缺少模块

时间:2017-06-06 18:46:56

标签: python tkinter python-3.4 cx-freeze

当我尝试将我的GUI应用程序与tkinter从python转换为exe时,会有一个警告告诉某些模块丢失。我试图将它们包含在setyp.py中,但没有任何改变。我相信从某些软件包中不能包含子目录。

GUI启动正常,但在尝试执行pandas命令时,脚本的功能会受到影响

我正在使用python 3.4和cx_Freeze 5.0.2

    Missing modules:
? BaseHTTPServer imported from setuptools.compat
? Cookie imported from requests.compat
? IPython imported from pandas.io.formats.format, pandas.io.formats.printing, pandas.util.testing
? IPython.core.debugger imported from pandas.util.testing
? IPython.core.formatters imported from pandas.io.formats.printing
? Image imported from openpyxl.drawing.image
? OpenSSL imported from requests.help
? OpenSSL.SSL imported from requests.packages.urllib3.contrib.pyopenssl, urllib3.contrib.pyopenssl
? OpenSSL.crypto imported from requests.packages.urllib3.contrib.pyopenssl, urllib3.contrib.pyopenssl
? PIL imported from openpyxl.conftest, openpyxl.drawing.image
? PyQt4 imported from pandas.io.clipboard
? PyQt4.QtGui imported from pandas.io.clipboard.clipboards
? SimpleHTTPServer imported from setuptools.compat
? StringIO imported from numpy.lib.format, numpy.lib.utils, numpy.testing.utils, pandas.compat, requests.compat, requests.packages.urllib3.packages.six, setuptools.compat, six, urllib3.packages.six
? UserDict imported from pytz.lazy
? __builtin__ imported from numpy, numpy.core.numeric, numpy.core.numerictypes, numpy.distutils.misc_util, numpy.lib._iotools, numpy.lib.function_base, numpy.ma.core, pandas.compat, setuptools.compat
? __main__ imported from bdb, pandas.core.common, pdb, pkg_resources, rlcompleter
? __version__ imported from numpy.f2py.setup
? _abcoll imported from openpyxl.compat.odict, requests.packages.urllib3.packages.ordered_dict, urllib3.packages.ordered_dict
? _curses imported from curses, curses.has_key
? _dummy_threading imported from dummy_threading
? _frozen_importlib imported from importlib
? _posixsubprocess imported from multiprocessing.util, subprocess
? _scproxy imported from urllib.request
? _sysconfigdata imported from sysconfig
? _winreg imported from numpy.distutils.cpuinfo, platform, requests.utils
? backports imported from pandas.compat
? backports.ssl_match_hostname imported from requests.packages.urllib3.packages.ssl_match_hostname, setuptools.ssl_support, urllib3.packages.ssl_match_hostname
? blinker imported from oauthlib.signals
? blosc imported from pandas.io.packers
? botocore.exceptions imported from pandas.io.s3
? bottleneck imported from pandas.core.nanops, pandas.util.testing
? bs4 imported from pandas.io.html
? bson.binary imported from tweepy.cache
? cPickle imported from numpy.core.numeric, numpy.lib.format, numpy.lib.npyio, numpy.ma.core, pandas.compat, tweepy.cache
? cStringIO imported from pandas.compat, pytz.tzfile, xlrd.timemachine
? ce imported from os
? code_generators.genapi imported from numpy.core.cversions
? code_generators.numpy_api imported from numpy.core.cversions
? commands imported from numpy.distutils.cpuinfo
? cookielib imported from requests.compat
? copy_reg imported from numpy.core
? cryptography imported from requests.help, requests.packages.urllib3.contrib.pyopenssl, urllib3.contrib.pyopenssl
? cryptography.hazmat.backends.openssl imported from requests.packages.urllib3.contrib.pyopenssl, urllib3.contrib.pyopenssl
? cryptography.hazmat.backends.openssl.x509 imported from requests.packages.urllib3.contrib.pyopenssl, urllib3.contrib.pyopenssl
? cryptography.x509.extensions imported from requests.packages.urllib3.contrib.pyopenssl, urllib3.contrib.pyopenssl
? cycler imported from pandas.plotting._core
? django.utils imported from tweepy.utils
? dummy_thread imported from openpyxl.compat.odict, requests.packages.urllib3.packages.ordered_dict, urllib3.packages.ordered_dict
? elementtree.ElementTree imported from xlrd.xlsx
? f2py2e imported from numpy.f2py.__main__
? fcntl imported from pandas.io.formats.terminal, tweepy.cache
? feather imported from pandas.io.feather_format
? future_builtins imported from numpy.lib.npyio, numpy.lib.recfunctions
? genapi imported from numpy.core.generate_numpy_api
? google.appengine.api imported from urllib3.contrib.appengine
? grp imported from distutils.archive_util, pathlib, shutil, tarfile
? gtk imported from pandas.io.clipboard, pandas.io.clipboard.clipboards
? html5lib imported from pandas.io.html
? htmlentitydefs imported from setuptools.compat
? httplib imported from pandas.compat, pandas.io.common, setuptools.compat
? java imported from unittest.mock
? java.lang imported from platform
? jinja2 imported from pandas.io.formats.style
? jwt imported from oauthlib.common, oauthlib.oauth2.rfc6749.clients.service_application
? jwt.algorithms imported from oauthlib.oauth1.rfc5849.signature
? lxml imported from pandas.io.html
? lxml.etree imported from openpyxl.conftest, openpyxl.xml, openpyxl.xml.functions, pandas.io.html, xlrd.xlsx
? lxml.html imported from pandas.io.html
? matplotlib imported from pandas.io.formats.style, pandas.plotting._compat, pandas.plotting._core, pandas.plotting._misc, pandas.plotting._timeseries, pandas.util.testing
? matplotlib.artist imported from pandas.plotting._core
? matplotlib.axes imported from pandas.plotting._core
? matplotlib.cm imported from pandas.plotting._style
? matplotlib.colors imported from pandas.plotting._style
? matplotlib.dates imported from pandas.plotting._converter
? matplotlib.lines imported from pandas.plotting._misc
? matplotlib.patches imported from pandas.plotting._core, pandas.plotting._misc
? matplotlib.pyplot imported from pandas.core.config_init, pandas.core.frame, pandas.io.formats.style, pandas.plotting._core, pandas.plotting._misc, pandas.plotting._style, pandas.plotting._timeseries, pandas.plotting._tools, pandas.util.testing
? matplotlib.table imported from pandas.plotting._tools
? matplotlib.ticker imported from pandas.plotting._converter, pandas.plotting._tools
? matplotlib.transforms imported from pandas.plotting._converter
? matplotlib.units imported from pandas.plotting._converter
? md5 imported from tweepy.cache
? mock imported from pandas.util.testing
? multiprocessing.AuthenticationError imported from multiprocessing.connection
? multiprocessing.BufferTooShort imported from multiprocessing.connection
? multiprocessing.TimeoutError imported from multiprocessing.pool
? multiprocessing.get_context imported from multiprocessing.managers, multiprocessing.pool, multiprocessing.sharedctypes
? multiprocessing.get_start_method imported from multiprocessing.spawn
? multiprocessing.set_start_method imported from multiprocessing.spawn
? nose imported from numpy.testing.decorators, numpy.testing.noseclasses, numpy.testing.utils, pandas.util.testing
? nose.plugins imported from numpy.testing.noseclasses
? nose.plugins.base imported from numpy.testing.noseclasses
? nose.plugins.builtin imported from numpy.testing.nosetester
? nose.plugins.errorclass imported from numpy.testing.noseclasses
? nose.util imported from numpy.testing.noseclasses
? ntlm imported from urllib3.contrib.ntlmpool
? numarray imported from numpy.distutils.system_info
? numexpr imported from pandas.core.computation, pandas.core.computation.engines, pandas.core.computation.expressions
? numpy._build_utils.apple_accelerate imported from numpy.core.setup
? numpy.core.equal imported from numpy.lib.user_array
? numpy.core.float32 imported from numpy.testing.utils
? numpy.core.geterrobj imported from numpy.linalg.linalg
? numpy.core.greater_equal imported from numpy.lib.user_array
? numpy.core.integer imported from numpy.fft.helper
? numpy.core.intp imported from numpy.linalg.linalg
? numpy.core.less_equal imported from numpy.lib.user_array
? numpy.core.longdouble imported from numpy.linalg.linalg
? numpy.core.object_ imported from numpy.linalg.linalg
? numpy.core.signbit imported from numpy.testing.utils
? numpy.core.subtract imported from numpy.lib.user_array
? numpy_api imported from numpy.core.generate_numpy_api
? numpy_distutils imported from numpy.f2py.diagnose
? numpy_distutils.command.build_flib imported from numpy.f2py.diagnose
? numpy_distutils.command.cpuinfo imported from numpy.f2py.diagnose
? numpy_distutils.cpuinfo imported from numpy.f2py.diagnose
? numpy_distutils.fcompiler imported from numpy.f2py.diagnose
? openpyxl.cell.get_column_letter imported from pandas.io.excel
? openpyxl.style imported from pandas.io.excel
? openpyxl.styles.NumberFormat imported from pandas.io.excel
? openpyxl.tests imported from openpyxl.reader.excel
? org.python.core imported from copy, pickle
? org.python.modules.posix.PosixModule imported from setuptools.sandbox
? os.path imported from distutils.file_util, numpy.core.cversions, numpy.core.memmap, numpy.core.setup, numpy.random.setup, openpyxl.packaging.manifest, openpyxl.reader.excel, os, pkg_resources, pkgutil, py_compile, pytz, pytz.tzfile, requests.adapters, setuptools.utils, shutil, sysconfig, tracemalloc, unittest.util, urllib3.contrib.securetransport, xlrd.xlsx
? packaging.specifiers imported from pkg_resources
? packaging.version imported from pkg_resources
? pandas_gbq imported from pandas.io.gbq
? pkg_resources.iter_entry_points imported from setuptools.command.egg_info
? pkg_resources.resource_stream imported from pytz
? pkg_resources.resource_string imported from setuptools.command.easy_install
? posix imported from os
? pudb imported from pandas.util.testing
? pwd imported from distutils.archive_util, distutils.util, getpass, http.server, netrc, pathlib, posixpath, shutil, tarfile, webbrowser
? py.path imported from pandas.io.common, pandas.util.testing
? pytest imported from openpyxl.conftest, pandas.util._tester, pandas.util.testing
? requests.packages.urllib3.packages.six.moves imported from requests.packages.urllib3.connectionpool, requests.packages.urllib3.response, requests.packages.urllib3.util.response
? requests.packages.urllib3.packages.six.moves.http_client imported from requests.packages.urllib3.connection, requests.packages.urllib3.exceptions
? requests.packages.urllib3.packages.six.moves.urllib.parse imported from requests.packages.urllib3.poolmanager, requests.packages.urllib3.request
? resource imported from test.support
? s3fs imported from pandas.io.common, pandas.io.s3
? scipy imported from numpy.testing.nosetester, pandas.core.missing, pandas.plotting._core
? scipy.interpolate imported from pandas.core.missing, pandas.util.testing
? scipy.signal imported from pandas.core.window
? scipy.sparse imported from pandas.core.dtypes.common, pandas.core.sparse.frame, pandas.core.sparse.scipy_sparse, pandas.util.testing
? scipy.stats imported from pandas.core.nanops, pandas.plotting._core, pandas.plotting._misc, pandas.util.testing
? sets imported from numpy.distutils.command.build_ext, numpy.distutils.fcompiler, numpy.distutils.misc_util, pytz.tzinfo
? setup_common imported from numpy.core.setup
? setuptools_svn imported from setuptools.command.egg_info
? simplejson imported from pandas.util._print_versions, requests.compat, tweepy.utils
? six.moves imported from dateutil.rrule, dateutil.tz._common, dateutil.tz.win
? six.moves.http_client imported from tweepy
? six.moves.urllib.parse imported from tweepy.auth, tweepy.binder, tweepy.utils
? socks imported from urllib3.contrib.socks
? sqlalchemy imported from pandas.io.sql
? sqlalchemy.ext.compiler imported from pandas.io.sql
? sqlalchemy.schema imported from pandas.io.sql
? sqlalchemy.types imported from pandas.io.sql
? tables imported from pandas.io.pytables
? termios imported from getpass, pandas.io.formats.terminal, tty
? thread imported from openpyxl.compat.odict, pandas.compat.chainmap_impl, requests.packages.urllib3.packages.ordered_dict, urllib3.packages.ordered_dict
? urllib.getproxies imported from requests.compat
? urllib.getproxies_environment imported from requests.compat
? urllib.pathname2url imported from pandas.io.common, setuptools.compat
? urllib.proxy_bypass imported from requests.compat
? urllib.proxy_bypass_environment imported from requests.compat
? urllib.quote imported from oauthlib.common, oauthlib.oauth2.rfc6749.utils, requests.compat
? urllib.quote_plus imported from requests.compat
? urllib.splittag imported from setuptools.compat
? urllib.unquote imported from oauthlib.common, requests.compat
? urllib.unquote_plus imported from requests.compat
? urllib.url2pathname imported from setuptools.compat
? urllib.urlencode imported from oauthlib.common, oauthlib.oauth1.rfc5849.endpoints.authorization, pandas.io.common, requests.compat
? urllib2 imported from numpy.lib._datasource, oauthlib.oauth1.rfc5849.utils, pandas.io.common, requests.compat, setuptools.compat
? urllib3.packages.six.moves imported from urllib3.connectionpool, urllib3.response, urllib3.util.response
? urllib3.packages.six.moves.http_client imported from urllib3.connection, urllib3.contrib.ntlmpool, urllib3.exceptions
? urllib3.packages.six.moves.urllib.parse imported from urllib3.contrib.appengine, urllib3.poolmanager, urllib3.request
? urlparse imported from numpy.lib._datasource, oauthlib.common, oauthlib.oauth1.rfc5849, oauthlib.oauth1.rfc5849.parameters, oauthlib.oauth1.rfc5849.signature, oauthlib.oauth2.rfc6749.parameters, oauthlib.oauth2.rfc6749.tokens, oauthlib.oauth2.rfc6749.utils, pandas.io.common, pandas.io.s3, pkg_resources, requests.compat, requests_oauthlib.oauth1_session, setuptools.compat
? vms_lib imported from platform
? win32com.gen_py imported from win32com
? wincertstore imported from setuptools.ssl_support
? xarray imported from pandas.core.generic, pandas.util.testing
? xlsxwriter imported from pandas.core.config_init, pandas.io.excel
? xlwt imported from pandas.io.excel
This is not necessarily a problem - the modules may not be needed on this platform.

我的setup.py

import os
from cx_Freeze import setup, Executable

os.environ['TCL_LIBRARY'] = "C:\\Python34\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\\Python34\\tcl\\tk8.6"

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"includes": ["tkinter", "tweepy", 'pandas','xlrd',
                                  'openpyxl','urllib3','requests','numpy','urllib', 'win32com', 'setuptools.compat'],
                     "packages": ['idna', 'numpy', 'pandas', 'urllib', 'win32com', 'urllib3']}
# build_exe_options = {"packages": ['idna', 'numpy', 'tkinter', 'tweepy', 'requests', 'openpyxl', 'urllib3','urllib']}

# GUI applications require a different base on Windows (the default is for a
# console application).
base = "Win32GUI"

setup(
    name="TwitterBot",
    version="0.1",
    description="Follow and send messages to twitter users",
    options={"build_exe": build_exe_options},
    executables=[Executable("twitterBotUI.py", base=base)])

0 个答案:

没有答案