Python 安装期间拒绝访问

Python access denied during installation

当我尝试在 Windows 服务器中安装 Python 3.8 时,我收到此错误消息:

下面的日志说了一些与密钥注册表相关的内容,我不确定,但它与写入密钥注册表的权限有关。我该如何解决?也许将 Python 版本更改为 3.7?

这里的这一行[47C8:33EC][2020-09-15T16:43:00]e000: Error 0x80070005: Failed to write run key value.是下面日志中的要点。

日志文件内容

[47C8:33EC][2020-09-15T16:42:59]i300: Apply begin
[47C8:33EC][2020-09-15T16:42:59]i010: Launching elevated engine process.
[47C8:33EC][2020-09-15T16:43:00]i011: Launched elevated engine process.
[47C8:33EC][2020-09-15T16:43:00]i012: Connected to elevated engine.
[3D08:1498][2020-09-15T16:43:00]i358: Pausing automatic updates.
[3D08:1498][2020-09-15T16:43:00]i359: Paused automatic updates.
[3D08:1498][2020-09-15T16:43:00]i360: Creating a system restore point.
[3D08:1498][2020-09-15T16:43:00]i362: System restore disabled, system restore point not created.
[47C8:33EC][2020-09-15T16:43:00]i370: Session begin, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{06afee40-d856-48c5-8ff2-bd1c3655edca}, options: 0x4, disable resume: No
[47C8:33EC][2020-09-15T16:43:00]i320: Registering bundle dependency provider: CPython-3.8, version: 3.8.150.0
[47C8:33EC][2020-09-15T16:43:00]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{06afee40-d856-48c5-8ff2-bd1c3655edca}, resume: Active, restart initiated: No, disable resume: No
[47C8:33EC][2020-09-15T16:43:00]e000: Error 0x80070005: Failed to write run key value.
[47C8:33EC][2020-09-15T16:43:00]e000: Error 0x80070005: Failed to update resume mode.
[47C8:33EC][2020-09-15T16:43:00]e000: Error 0x80070005: Failed to begin registration session.
[47C8:33EC][2020-09-15T16:43:00]e000: Error 0x80070005: Failed to register bundle.
[47C8:33EC][2020-09-15T16:43:00]i399: Apply complete, result: 0x80070005, restart: None, ba requested restart:  No

您使用的是官方 Python 发行版吗?

第三方发行版可以有不同的注册码,Windows 可能不会检查这些。

您可以在此处阅读更多相关信息:

PEP 514 -- Python registration in the Windows registry

这是一个权限问题。

转到 python exe 文件,right-click 文件和 select“运行 以管理员身份”,然后继续安装步骤。这次python就安装成功了

希望对你有所帮助。