我希望有人可以帮助我调试来自 pyinstall 的以下错误消息。
我正在尝试将脚本编译为 exe,并且几天来一直在处理隐藏模块,但是我遇到了一条新的错误消息,它似乎是缺少 .dll 文件。
问题是,我不知道是哪一个导致了问题。希望有编译经验的人可以帮助我调试这个错误信息。查看回溯,“scipy.interpolate”和“scipy.linalg”似乎很重要。但是,我已将它们包含在 pyinstall 的 .spec 文件中,它不会更改输出。
该脚本使用 GDAL,因此我在构建文件夹中包含了 gdal111.dll、geos_c.dll。
我也通过dependency walker运行了脚本,但是我真的不知道我在做什么或要寻找什么。这是 DLL 的屏幕截图。也许这对我来说并不明显,但它们看起来不像 python 的。
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
import marshal # builtin
import _struct # builtin
import nt # builtin
import imp # builtin
import zlib # builtin
import errno # builtin
import _weakref # builtin
import _codecs # builtin
import _sre # builtin
import _locale # builtin
import _ctypes # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\_ctypes.pyd
import PIL._imaging # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\PIL._imaging.pyd
import _collections # builtin
import operator # builtin
import itertools # builtin
import _heapq # builtin
import thread # builtin
import _io # builtin
import array # builtin
import math # builtin
import strop # builtin
import _functools # builtin
import binascii # builtin
import _hashlib # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\_hashlib.pyd
import _random # builtin
import cStringIO # builtin
import time # builtin
import datetime # builtin
import _socket # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\_socket.pyd
import _ssl # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\_ssl.pyd
import parser # builtin
import win32api # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\win32api.pyd
import pywintypes # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\pywintypes27.dll
import pythoncom # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\pythoncom27.dll
import pyproj._proj # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\pyproj._proj.pyd
import numpy.core.multiarray # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\numpy.core.multiarray.pyd
import numpy.core.umath # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\numpy.core.umath.pyd
import cPickle # builtin
import numpy.core._dotblas # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\numpy.core._dotblas.pyd
import numpy.core.scalarmath # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\numpy.core.scalarmath.pyd
import numpy.lib._compiled_base # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\numpy.lib._compiled_base.pyd
import numpy.linalg.lapack_lite # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\numpy.linalg.lapack_lite.pyd
import numpy.linalg._umath_linalg # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\numpy.linalg._umath_linalg.pyd
import future_builtins # builtin
import numpy.fft.fftpack_lite # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\numpy.fft.fftpack_lite.pyd
import numpy.random.mtrand # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\numpy.random.mtrand.pyd
import pandas.hashtable # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\pandas.hashtable.pyd
import _winreg # builtin
import gc # builtin
import msvcrt # builtin
import _subprocess # builtin
import _bisect # builtin
import pandas.tslib # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\pandas.tslib.pyd
import pandas.lib # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\pandas.lib.pyd
import _csv # builtin
import pandas.algos # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\pandas.algos.pyd
import pandas.index # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\pandas.index.pyd
import pandas._period # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\pandas._period.pyd
import pandas._sparse # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\pandas._sparse.pyd
import matplotlib._path # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\matplotlib._path.pyd
import _ast # builtin
import pandas.parser # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\pandas.parser.pyd
import pandas.json # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\pandas.json.pyd
import pandas.msgpack # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\pandas.msgpack.pyd
import pandas._testing # dynamically loaded from C:\Users\Hp\AppData\Local\Temp\_MEI84482\pandas._testing.pyd
Traceback (most recent call last):
File "<string>", line 13, in <module>
File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\scipy.interpolate", line 145, in <module>
File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\scipy.interpolate.interpolate", line 15, in <module>
File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\scipy.linalg", line 172, in <module>
File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\scipy.linalg.misc", line 5, in <module>
File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\scipy.linalg.blas", line 155, in <module>
File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 409, in load_module
module = imp.load_module(fullname, fp, filename, self._c_ext_tuple)
ImportError: DLL load failed: The specified module could not be found.