在win11系统下,即使登录用户为Administrator,在使用pyinstaller生成exe时依然提示权限不够,报错如下:
Exception: Unable to access file 'C:\WINDOWS\system32\api-ms-win-crt-math-l1-1-0.dll': [Errno 13] Permission denied: 'C:\\WINDOWS\\system32\\api-ms-win-crt-math-l1-1-0.dll'
解决方法:
找到cmd(PowerShell同理),选择以管理员身份运行,即可正常生成exe,如下图所示:
另:在win7系统,如果以Administrator登录则无需再以管理员身份运行cmd。