__main.pyInstallerImporter未能加载dynlib/dll“shcore”

2024-05-16 19:03:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用pyinstaller打包一个exe文件

它可以在我的电脑中正常运行(Win 10)

但在另一个人的电脑(Win7)中,它显示

__main__.pyinstallerimporterror failed to load dynlib/dll "shcore".

关于shcore,我使用

import ctypes
PROCESS_PER_MONITOR_DPI_AWARE = 2
ctypes.windll.shcore.SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE)

我该怎么办? 提前谢谢


Tags: 文件mainctypesprocessexewinmonitoraware
1条回答
网友
1楼 · 发布于 2024-05-16 19:03:55

^{}支持的最低客户端是Windows 8.1

根据^{}的规定:

In previous versions of Windows, there was no setting for PROCESS_PER_MONITOR_DPI_AWARE. Apps were either DPI unaware or DPI aware. Legacy applications that were classified as DPI aware before Windows 8.1 are considered to have a PROCESS_DPI_AWARENESS setting of PROCESS_SYSTEM_DPI_AWARE in current versions of Windows.

您只能使用^{}设置系统DPI感知

相关问题 更多 >