对python应用程序的依赖关系跟踪

时间:2018-06-22 09:38:39

标签: python-3.4 py2exe gdal rasterio

我正在尝试使用在Windows 7上使用python3.4开发的python应用程序制作便携式应用程序-32位。我的第一个想法是将py2exe与ThinApp等效项结合使用,但是由于我使用的rasterio不是纯python库,因此py2exe无法找到一些DLL。 如果我尝试运行生成的可执行文件,则会出现此错误:

File Traceback (most recent call last):
  File "viewer.py", line 3, in <module>
    import MainWindow as GUI
  File "C:\Users\IEUser\Documents\viewer-dev\viewer\MainWindow.py", line 2, in <module>
    import ImageWindow
  File "C:\Users\IEUser\Documents\viewer-dev\viewer\ImageWindow.py", line 1, in <module>
    import Resampler
  File "C:\Users\IEUser\Documents\viewer-dev\viewer\Resampler.py", line 1, in <module>
    import rasterio
  File "C:\Python34\lib\site-packages\rasterio\__init__.py", line 31, in <module>
    from rasterio._base import gdal_version
  File "<loader>", line 10, in <module>
  File "<loader>", line 8, in __load
ImportError: (DLL load failed: The specified module could not be found.) 'C:\\Users\\IEUser\\Documents\\viewer-dev\\dist\\rasterio._base.pyd'

我读到我必须在dist目录中手动添加这些DLL,但是我想知道如何才能获得所需DLL的列表?

1 个答案:

答案 0 :(得分:0)

您可以在py2exe上使用Dependency Walker来查看所有缺少的依赖项。

检查可执行文件和所有链接的库(PYD和DLL文件)

相关问题