从 python 制作可执行文件不起作用

Making an executable from python does not work

在过去的 6 个小时里,我一直在努力将我的代码变成可执行文件。我使用过 pyinstaller,也尝试过 auto-py-to-exe。然而,当我继续转换文件时,有一堆丢失的模块等。我有几个导入:

from calendar import Calendar
from datetime import date
import sys
from tkinter.messagebox import showwarning
from tkinter.tix import MAX, CheckList
sys.path.append(r'c:\users\a384663\appdata\local\programs\python\python39\lib\site-packages')
from errno import ERANGE
from importlib.metadata import entry_points
from itertools import count
from tkinter import Frame, Spinbox, StringVar, Toplevel, filedialog
import tkinter as tk
from tkinter.constants import HORIZONTAL, X
from tkinter.ttk import Combobox, Progressbar
from tkinter import *
from turtle import done
import pandas as pd
import math
import numpy as np
import os
from os import listdir
from os.path import isfile, join
import matplotlib
import matplotlib.path as mplPath
import matplotlib.pyplot as plt
from tkcalendar import Calendar
from datetime import datetime
import tkinter as tk
from tkinter import ttk
import time

据我所知这里没有什么可疑的?但是,当我开始该过程时,我的 dist 文件夹中出现以下警告文件:

(我剪掉了一些部分以便它适合这里)


This file lists modules PyInstaller was not able to find. This does not
necessarily mean this module is required for running you program. Python and
Python 3rd-party packages include a lot of conditional or optional modules. For
example the module 'ntpath' only exists on Windows, whereas the module
'posixpath' only exists on Posix systems.

Types if import:
* top-level: imported at the top-level - look at these first
* conditional: imported within an if-statement
* delayed: imported from within a function
* optional: imported within a try-except-statement

IMPORTANT: Do NOT post this list to the issue-tracker. Use it as a basis for
           yourself tracking down the missing module. Thanks!

missing module named 'org.python' - imported by copy (optional), xml.sax (delayed, conditional), setuptools.sandbox (conditional)
missing module named _posixsubprocess - imported by subprocess (optional), multiprocessing.util (delayed)
missing module named grp - imported by subprocess (optional), shutil (optional), tarfile (optional), pathlib (delayed, optional), distutils.archive_util (optional), gevent.subprocess (optional)
missing module named pwd - imported by posixpath (delayed, conditional), subprocess (optional), shutil (optional), tarfile (optional), pathlib (delayed, conditional, optional), http.server (delayed, optional), webbrowser (delayed), netrc (delayed, conditional), getpass (delayed), distutils.util (delayed, conditional, optional), distutils.archive_util (optional), psutil (optional), gevent.subprocess (optional)
missing module named _posixshmem - imported by multiprocessing.resource_tracker (conditional), multiprocessing.shared_memory (conditional)
missing module named multiprocessing.set_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
missing module named multiprocessing.get_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
missing module named urllib.FancyURLopener - imported by urllib (conditional, optional), pygments.lexers._sourcemod_builtins (conditional, optional)
missing module named urllib.urlretrieve - imported by urllib (conditional, optional), pygments.lexers._php_builtins (conditional, optional)
missing module named urllib.urlopen - imported by urllib (conditional, optional), pygments.lexers._lua_builtins (conditional, optional), pygments.lexers._postgres_builtins (conditional, optional)
missing module named urllib.getproxies_environment - imported by urllib (conditional), requests.compat (conditional)
missing module named urllib.proxy_bypass_environment - imported by urllib (conditional), requests.compat (conditional)
missing module named urllib.proxy_bypass - imported by urllib (conditional), requests.compat (conditional)
missing module named urllib.getproxies - imported by urllib (conditional), requests.compat (conditional)
missing module named urllib.urlencode - imported by urllib (conditional), requests.compat (conditional)
missing module named urllib.unquote_plus - imported by urllib (conditional), requests.compat (conditional)
missing module named urllib.quote_plus - imported by urllib (conditional), requests.compat (conditional)
missing module named urllib.unquote - imported by urllib (conditional), requests.compat (conditional), gevent.pywsgi (optional)
missing module named urllib.quote - imported by urllib (conditional), requests.compat (conditional)
missing module named urllib.pathname2url - imported by urllib (conditional), PyInstaller.lib.modulegraph._compat (conditional)
missing module named posix - imported by os (conditional, optional), shutil (conditional), importlib._bootstrap_external (conditional)
missing module named resource - imported by posix (top-level), test.support (delayed, conditional, optional), IPython.utils.timing (optional), psutil._pslinux (optional)
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level), PyInstaller.loader.pyimod02_archive (delayed)
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level)
missing module named multiprocessing.get_context - imported by multiprocessing (top-level), multiprocessing.pool (top-level), multiprocessing.managers (top-level), multiprocessing.sharedctypes (top-level)
missing module named multiprocessing.TimeoutError - imported by multiprocessing (top-level), multiprocessing.pool (top-level), numba.testing.main (optional)
missing module named fcntl - imported by xmlrpc.server (optional), zmq.eventloop.minitornado.platform.posix (top-level), psutil._compat (delayed, optional), gevent.fileobject (optional), gevent.os (optional), gevent.subprocess (conditional)
missing module named termios - imported by tty (top-level), getpass (optional), IPython.core.page (delayed, optional), prompt_toolkit.input.vt100 (top-level), psutil._compat (delayed, optional)
missing module named vms_lib - imported by platform (delayed, optional)
missing module named 'java.lang' - imported by platform (delayed, optional), xml.sax._exceptions (conditional)
missing module named java - imported by platform (delayed)
missing module named _winreg - imported by platform (delayed, optional), requests.utils (delayed, conditional, optional), babel.localtime._win32 (optional), pkg_resources._vendor.appdirs (delayed, conditional), pygments.formatters.img (optional)
missing module named _scproxy - imported by urllib.request (conditional)
missing module named multiprocessing.BufferTooShort - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
missing module named multiprocessing.AuthenticationError - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
missing module named multiprocessing.cpu_count - imported by multiprocessing (top-level), gevent.testing.testrunner (top-level)
missing module named multiprocessing.freeze_support - imported by multiprocessing (conditional), numba.runtests (conditional)
missing module named multiprocessing.Pool - imported by multiprocessing (delayed, conditional), scipy._lib._util (delayed, conditional)
missing module named multiprocessing.Process - imported by multiprocessing (top-level), jupyter_client.ssh.tunnel (top-level), gevent.tests.test__issue600 (top-level)
missing module named asyncio.DefaultEventLoopPolicy - imported by asyncio (delayed, conditional), asyncio.events (delayed, conditional)
missing module named readline - imported by cmd (delayed, conditional, optional), code (delayed, conditional, optional), pdb (delayed, optional), pstats (conditional, optional)
missing module named org - imported by pickle (optional)
missing module named 'win32com.gen_py' - imported by win32com (conditional, optional), C:\Users\a384663\AppData\Local\Programs\Python\Python39\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_win32comgenpy.py (top-level)
missing module named pyimod03_importers - imported by C:\Users\a384663\AppData\Local\Programs\Python\Python39\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgutil.py (top-level), C:\Users\a384663\AppData\Local\Programs\Python\Python39\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgres.py (top-level)
missing module named _manylinux - imported by packaging._manylinux (delayed, optional), setuptools._vendor.packaging._manylinux (delayed, optional), pkg_resources._vendor.packaging._manylinux (delayed, optional)
missing module named railroad - imported by pyparsing.diagram (top-level)
missing module named 'pkg_resources.extern.pyparsing' - imported by pkg_resources._vendor.packaging.markers (top-level), pkg_resources._vendor.packaging.requirements (top-level)
missing module named 'pkg_resources.extern.more_itertools' - imported by pkg_resources._vendor.jaraco.functools (top-level)
missing module named 'pkg_resources.extern.importlib_resources' - imported by pkg_resources._vendor.jaraco.text (optional)
missing module named 'typing.io' - imported by importlib.resources (top-level)
missing module named 'com.sun' - imported by numba.misc.appdirs (delayed, conditional, optional), pkg_resources._vendor.appdirs (delayed, conditional, optional)
missing module named __builtin__ - imported by debugpy.common.compat (conditional), gevent._compat (conditional), gevent.monkey (conditional), gevent.testing.six (conditional), gevent.builtins (optional), gevent._ffi.loop (conditional), gevent.libev.corecffi (conditional), gevent.backdoor (delayed, optional), pkg_resources._vendor.pyparsing (conditional), setuptools._vendor.pyparsing (conditional)
missing module named ordereddict - imported by pkg_resources._vendor.pyparsing (optional), setuptools._vendor.pyparsing (optional)
missing module named pkg_resources.extern.packaging - imported by pkg_resources.extern (top-level), pkg_resources (top-level)
missing module named pkg_resources.extern.appdirs - imported by pkg_resources.extern (top-level), pkg_resources (top-level)
missing module named 'pkg_resources.extern.jaraco' - imported by pkg_resources (top-level), pkg_resources._vendor.jaraco.text (top-level)
missing module named Tkinter - imported by tkcalendar.dateentry (optional), tkcalendar.tooltip (optional)
missing module named cdecimal - imported by babel._compat (conditional, optional)
missing module named cPickle - imported by pycparser.ply.yacc (delayed, optional), pickleshare (optional), babel._compat (conditional), gevent._tblib (delayed, optional)
missing module named copy_reg - imported by cPickle (top-level), cStringIO (top-level), gevent._tblib (delayed, optional)
missing module named StringIO - imported by PyInstaller.lib.modulegraph._compat (conditional), PyInstaller.lib.modulegraph.zipio (conditional), six (conditional), urllib3.packages.six (conditional), requests.compat (conditional), babel._compat (conditional)
missing module named cStringIO - imported by cPickle (top-level), cffi.ffiplatform (optional), xlrd.timemachine (conditional), babel._compat (conditional), gevent.tests.test__pywsgi (optional)
missing module named sets - imported by pytz.tzinfo (optional)
missing module named UserDict - imported by attr._compat (conditional), pytz.lazy (optional)
missing module named tkFont - imported by tkcalendar.calendar_ (optional)
missing module named ttk - imported by tkcalendar.dateentry (optional), tkcalendar.calendar_ (optional), tkcalendar.tooltip (optional)
missing module named 'nose.plugins' - imported by numpy.testing._private.noseclasses (top-level), numpy.testing._private.nosetester (delayed)
missing module named pickle5 - imported by numpy.compat.py3k (optional), numba.cloudpickle.compat (conditional, optional)
missing module named _dummy_thread - imported by cffi.lock (conditional, optional), numpy.core.arrayprint (optional)
missing module named numpy.array - imported by numpy (top-level), numpy.ma.core (top-level), numpy.ma.extras (top-level), numpy.ma.mrecords (top-level), scipy.interpolate.interpolate (top-level), scipy.linalg.decomp (top-level), scipy.linalg.decomp_schur (top-level), scipy.sparse.linalg.isolve.utils (top-level), scipy.interpolate._fitpack_impl (top-level), scipy.interpolate.fitpack2 (top-level), scipy.stats.stats (top-level), scipy.optimize.lbfgsb (top-level), scipy.optimize.tnc (top-level), scipy.optimize.slsqp (top-level), scipy.integrate._ode (top-level), scipy.misc.common (top-level), scipy.stats.morestats (top-level)
missing module named numpy.recarray - imported by numpy (top-level), numpy.ma.mrecords (top-level)
missing module named numpy.ndarray - imported by numpy (top-level), numpy.ma.core (top-level), numpy.ma.extras (top-level), IPython.core.magics.namespace (delayed, conditional, optional), numpy.ma.mrecords (top-level), numpy.ctypeslib (top-level), pandas.compat.numpy.function (top-level), numpy.typing._array_like (top-level), scipy.stats._distn_infrastructure (top-level), scipy.stats.mstats_basic (top-level), scipy.stats.mstats_extras (top-level)
missing module named numpy.dtype - imported by numpy (top-level), numpy.ma.mrecords (top-level), numpy.ctypeslib (top-level), scipy.optimize.minpack (top-level), numpy.typing._array_like (top-level)
missing module named numpy.bool_ - imported by numpy (top-level), numpy.ma.core (top-level), numpy.ma.mrecords (top-level), numpy.typing._array_like (top-level)
missing module named numpy.expand_dims - imported by numpy (top-level), numpy.ma.core (top-level)
missing module named numpy.iscomplexobj - imported by numpy (top-level), numpy.ma.core (top-level), scipy.linalg.decomp (top-level), scipy.linalg._decomp_ldl (top-level)
missing module named numpy.amin - imported by numpy (top-level), numpy.ma.core (top-level), scipy.stats.morestats (top-level)
missing module named numpy.amax - imported by numpy (top-level), numpy.ma.core (top-level), scipy.linalg.matfuncs (top-level), scipy.stats.morestats (top-level)
missing module named numpy.histogramdd - imported by numpy (delayed), numpy.lib.twodim_base (delayed)
missing module named numpy.core.ufunc - imported by numpy.core (top-level), numpy.lib.utils (top-level)
missing module named numpy.core.ones - imported by numpy.core (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.core.hstack - imported by numpy.core (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.core.atleast_1d - imported by numpy.core (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.core.atleast_3d - imported by numpy.core (top-level), numpy.lib.shape_base (top-level)
missing module named numpy.core.vstack - imported by numpy.core (top-level), numpy.lib.shape_base (top-level)
missing module named numpy.core.linspace - imported by numpy.core (top-level), numpy.lib.index_tricks (top-level)
missing module named numpy.core.roll - imported by numpy.core (top-level), numpy.fft.helper (top-level)
missing module named numpy.core.integer - imported by numpy.core (top-level), numpy.fft.helper (top-level)
missing module named numpy.core.take - imported by numpy.core (top-level), numpy.fft._pocketfft (top-level)
missing module named numpy.core.conjugate - imported by numpy.core (top-level), numpy.fft._pocketfft (top-level)
missing module named numpy.core.result_type - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.float_ - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.number - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.bool_ - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.inf - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.array2string - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.signbit - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.isscalar - imported by numpy.core (delayed), numpy.testing._private.utils (delayed), numpy.lib.polynomial (top-level)
missing module named numpy.core.isinf - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.isnat - imported by numpy.core (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.core.ndarray - imported by numpy.core (top-level), numpy.testing._private.utils (top-level), numpy.lib.utils (top-level)
missing module named numpy.core.array_repr - imported by numpy.core (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.core.arange - imported by numpy.core (top-level), numpy.testing._private.utils (top-level), numpy.fft.helper (top-level)
missing module named numpy.core.float32 - imported by numpy.core (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.core.transpose - imported by numpy.core (top-level), numpy.lib.function_base (top-level)
missing module named numpy.core.iinfo - imported by numpy.core (top-level), numpy.lib.twodim_base (top-level)
missing module named numpy.core.sort - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.argsort - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.sign - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.isnan - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (delayed)

missing module named _curses - imported by curses (top-level), curses.has_key (top-level)
runtime module named six.moves - imported by cycler (top-level), dateutil.rrule (top-level), dateutil.tz.tz (top-level), dateutil.tz._factories (top-level), dateutil.tz.win (top-level), asttokens.asttokens (top-level)
missing module named six.moves.xrange - imported by six.moves (top-level), asttokens.asttokens (top-level)
missing module named six.moves.range - imported by six.moves (top-level), dateutil.rrule (top-level)
missing module named six.moves.zip - imported by six.moves (top-level), cycler (top-level)
missing module named dateutil.tz.tzfile - imported by dateutil.tz (top-level), dateutil.zoneinfo (top-level)
missing module named olefile - imported by PIL.MicImagePlugin (top-level), PIL.FpxImagePlugin (top-level)
missing module named pygments.formatters.LatexFormatter - imported by pygments.formatters (delayed), IPython.lib.display (delayed)
missing module named numpy.unsignedinteger - imported by numpy (top-level), numpy.typing._array_like (top-level)
missing module named numpy.double - imported by numpy (top-level), scipy.optimize._nnls (top-level)
missing module named numpy.greater - imported by numpy (top-level), scipy.optimize.minpack (top-level)
missing module named numpy.float64 - imported by numpy (top-level), scipy.optimize.lbfgsb (top-level)
missing module named numpy.sign - imported by numpy (top-level), scipy.linalg.matfuncs (top-level)

missing module named numba.typed.List - imported by numba.typed (delayed), numba.core.typing.typeof (delayed), numba.core.codegen (delayed), numba.typed.listobject (delayed), sparse._compressed.convert (top-level)
missing module named graphviz - imported by llvmlite.binding.analysis (delayed), numba.core.ir (delayed, optional), numba.core.controlflow (delayed, optional), numba.misc.inspection (delayed, optional), numba.core.codegen (delayed)
missing module named llvmlite.ir.Value - imported by llvmlite.ir (delayed), llvmlite.ir.types (delayed)
missing module named llvmlite.ir.Constant - imported by llvmlite.ir (delayed), llvmlite.ir.types (delayed), numba.cpython.unicode (top-level)
missing module named llvmlite.ir.GlobalVariable - imported by llvmlite.ir (delayed), llvmlite.ir.types (delayed)
missing module named llvmlite.ir.Module - imported by llvmlite.ir (delayed), llvmlite.ir.types (delayed)
missing module named numba.core.types.WrapperAddressProtocol - imported by numba.core.types (top-level), numba.experimental.function_type (top-level)
missing module named numba.core.types.FunctionPrototype - imported by numba.core.types (top-level), numba.experimental.function_type (top-level)
missing module named numba.core.types.UndefinedFunctionType - imported by numba.core.types (top-level), numba.experimental.function_type (top-level)
missing module named numba.core.types.FunctionType - imported by numba.core.types (top-level), numba.experimental.function_type (top-level)
missing module named numba.core.types.Tuple - imported by numba.core.types (delayed), numba.core.types.iterators (delayed), numba.core.types.npytypes (delayed)
missing module named numba.core.types.Array - imported by numba.core.types (delayed), numba.core.types.abstract (delayed)
missing module named numba.np.ufunc.tbbpool - imported by numba.np.ufunc (delayed, conditional, optional), numba.np.ufunc.parallel (delayed, conditional, optional)
missing module named cuda - imported by numba.core.config (delayed, conditional, optional), numba.cuda.cudadrv.driver (conditional)
missing module named 'elftools.elf' - imported by numba.core.codegen (delayed)
missing module named elftools - imported by numba.core.codegen (delayed)
missing module named r2pipe - imported by numba.misc.inspection (delayed, optional)
missing module named com - imported by numba.misc.appdirs (delayed)
missing module named numba.types.uint64 - imported by numba.types (top-level), numba.cuda.mathimpl (top-level)
missing module named numba.types.int64 - imported by numba.types (top-level), numba.cuda.libdevicefuncs (top-level), numba.cuda.mathimpl (top-level)
missing module named numba.types.float64 - imported by numba.types (top-level), numba.cuda.libdevicefuncs (top-level), numba.cuda.mathimpl (top-level)
missing module named numba.types.float32 - imported by numba.types (top-level), numba.cuda.libdevicefuncs (top-level), numba.cuda.mathimpl (top-level)
missing module named numba.types.Tuple - imported by numba.types (top-level), numba.cuda.libdevicefuncs (top-level)
missing module named numba.types.void - imported by numba.types (top-level), numba.cuda.libdevicefuncs (top-level)
missing module named numba.types.int32 - imported by numba.types (top-level), numba.cuda.libdevicefuncs (top-level)
missing module named numba.types.int16 - imported by numba.types (top-level), numba.cuda.libdevicefuncs (top-level)
missing module named xmlrunner - imported by numba.testing (delayed, conditional)
missing module named git - imported by numba.testing.main (delayed, optional)
missing module named numba.cuda.is_available - imported by numba.cuda (delayed), numba.cuda.testing (delayed)
missing module named numba.core.types.NoneType - imported by numba.core.types (top-level), numba.typed.listobject (top-level)
missing module named numba.core.types.Type - imported by numba.core.types (top-level), numba.typed.listobject (top-level), numba.typed.dictobject (top-level)
missing module named numba.core.types.ListTypeIteratorType - imported by numba.core.types (top-level), numba.typed.listobject (top-level)
missing module named numba.core.types.ListTypeIterableType - imported by numba.core.types (top-level), numba.typed.listobject (top-level)
missing module named yaml - imported by numba.core.config (optional)
missing module named numba.core.types.ListType - imported by numba.core.types (top-level), numba.typed.listobject (top-level), numba.typed.typedlist (top-level)
missing module named numba.core.types.DictIteratorType - imported by numba.core.types (top-level), numba.typed.dictobject (top-level)
missing module named numba.core.types.DictValuesIterableType - imported by numba.core.types (top-level), numba.typed.dictobject (top-level)
missing module named numba.core.types.DictKeysIterableType - imported by numba.core.types (top-level), numba.typed.dictobject (top-level)
missing module named numba.core.types.DictItemsIterableType - imported by numba.core.types (top-level), numba.typed.dictobject (top-level)
missing module named numba.core.types.DictType - imported by numba.core.types (top-level), numba.typed.typeddict (top-level), numba.typed.dictobject (top-level)
missing module named numba.typed.Dict - imported by numba.typed (delayed), numba.core.typing.typeof (delayed), numba.typed.dictobject (delayed, conditional), numba.typed.dictimpl (delayed)
missing module named scikits - imported by scipy.sparse.linalg.dsolve.linsolve (optional)
missing module named scipy.special.gammaln - imported by scipy.special (top-level), scipy.special.spfun_stats (top-level), scipy.optimize._dual_annealing (top-level), scipy.integrate._quadrature (top-level), scipy.stats._discrete_distns (top-level), scipy.stats._hypotests (top-level), scipy.stats._multivariate (top-level)
missing module named scipy.special.airy - imported by scipy.special (top-level), scipy.special.orthogonal (top-level)
missing module named scipy.special.poch - imported by scipy.special (top-level), scipy.fft._fftlog (top-level)
missing module named scipy.special.loggamma - imported by scipy.special (top-level), scipy.fft._fftlog (top-level)
missing module named scipy.linalg.qr_insert - imported by scipy.linalg (top-level), scipy.sparse.linalg.isolve._gcrotmk (top-level)
missing module named uarray - imported by scipy._lib.uarray (conditional, optional)
missing module named scipy.linalg._flapack_64 - imported by scipy.linalg (optional), scipy.linalg.lapack (optional)
missing module named scipy.linalg._clapack - imported by scipy.linalg (optional), scipy.linalg.lapack (optional)
missing module named scipy.linalg._fblas_64 - imported by scipy.linalg (optional), scipy.linalg.blas (optional)
missing module named scipy.linalg._cblas - imported by scipy.linalg (optional), scipy.linalg.blas (optional)
missing module named botocore - imported by pandas.io.common (delayed, conditional, optional)
missing module named 'pyarrow.compute' - imported by pandas.core.arrays.string_arrow (conditional)
missing module named hypothesis - imported by pandas.util._tester (delayed, optional)
missing module named 'lxml.html' - imported by pandas.io.html (delayed)
missing module named iconv_codec - imported by bs4.dammit (optional)
missing module named cchardet - imported by bs4.dammit (optional)
missing module named 'html5lib.treebuilders' - imported by bs4.builder._html5lib (optional)
missing module named 'html5lib.constants' - imported by bs4.builder._html5lib (top-level)
missing module named html5lib - imported by bs4.builder._html5lib (top-level)
missing module named pandas.ExtensionArray - imported by pandas (conditional), pandas.core.construction (conditional)
missing module named toml - imported by pep517.compat (conditional)
missing module named zipp - imported by pep517.meta (optional)

我的想法是pyinstaller或过时模块中可能存在错误?我已经尝试更新两者,但没有成功。

有人有想法吗?提前致谢!

好的,所以我让你的代码作为可执行文件在我这边工作。我会说第一次使用 auto-py-to-exe 时的技巧 'conversion to exe' 是 select 'Console Based' 然后一旦你有输出,从命令行启动它 - 所以在如果出现错误,您可以看到发生了什么并进行调整。

无论如何,这就是它对我有用的方式。从命令行:

  • cd 进入您的桌面
  • 然后'python -m venv myenv'
  • cd 进入 myenv (cd myenv)
  • cd 进入脚本(cd 脚本)
  • 键入 'activate' 然后按 Enter

现在您已进入虚拟环境,从您的代码安装非 built-in 包:

pip install pandas
pip install matplotlib
pip install tkcalendar
pip install auto-py-to-exe

现在你的包已经安装好了,仍然在命令行中(并且仍然激活你的虚拟环境)类型:

auto-py-to-exe
  • select 您的输入文件(在我的例子中,我使用了您的代码 + print() 语句,所以我可以在我的控制台中包含一些东西)

  • select选项'One file'

  • select选项'Console Based'

  • 然后点击'Convert .py to .exe'

一旦您的可执行文件准备就绪,打开一个新的命令提示符并导航 (cd) 到它的文件夹。 然后键入您的可执行文件的名称 - 在我的例子中,它是:

testfile.exe

控制台向我打印:'all good'。如果它为您打印其他内容,您将从控制台更清楚地了解您遇到的问题。

仅供参考,我在 testfile.py:

中使用的代码
from calendar import Calendar
from datetime import date
import sys
from tkinter.messagebox import showwarning
from tkinter.tix import MAX, CheckList
sys.path.append(r'c:\users\a384663\appdata\local\programs\python\python39\lib\site-packages')
from errno import ERANGE
from importlib.metadata import entry_points
from itertools import count
from tkinter import Frame, Spinbox, StringVar, Toplevel, filedialog
import tkinter as tk
from tkinter.constants import HORIZONTAL, X
from tkinter.ttk import Combobox, Progressbar
from tkinter import *
from turtle import done
import pandas as pd
import math
import numpy as np
import os
from os import listdir
from os.path import isfile, join
import matplotlib
import matplotlib.path as mplPath
import matplotlib.pyplot as plt
from tkcalendar import Calendar
from datetime import datetime
import tkinter as tk
from tkinter import ttk
import time

print('all good')