python-3.4 - python应用程序的依赖跟踪
问题描述
我正在尝试从使用 python3.4 在 Windows 7 - 32 位上开发的 python 应用程序制作可移植应用程序。我的第一个想法是将 py2exe 与 ThinApp 等效项结合使用,但由于我使用的不是纯 python 库的 rasterio,因此 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 的列表?
解决方案
您可以在 py2exe 上使用Dependency Walker来查看所有缺少的依赖项。
检查可执行文件和所有链接库(PYD 和 DLL 文件)
推荐阅读
- hadoop - hdfs ls on directory 返回 No such file or directory 错误
- mysql - 我们如何在 Google Cloud SQL 中检索日志文件路径
- python - 为 Python 3 安装模式
- mysql - Mysql Query where max(time) 小于今天
- node.js - 在 MongoDb 连接失败的情况下如何向前端发送消息
- mysql - 如何在mysql中将列拆分为多行(以管道作为分隔符)?
- typo3 - 如何在 TYPO3 中禁用一页的扩展名
- java - 使用 google tink 流编码问题的字节数组
- angular - 从单个模板角度动态创建组件
- angular - 角度转换 HttpClient 响应 - 类或接口