'Choco install python' 在 AppVeyor 上以 1603 失败

问题描述 投票:0回答:4

我有一个从 Chocolatey 安装 Python 的 PowerShell 构建脚本:

choco install python -y

但是即使它在本地机器上运行,在 AppVeyor 上运行它也会半静默地失败:

[00:01:07] Chocolatey v0.10.3
[00:01:07] Installing the following packages:
[00:01:07] python
[00:01:07] By installing you accept licenses for the packages.
[00:01:08]
[00:01:08] python3 v3.6.0 [Approved]
[00:01:08] python3 package files install completed. Performing other installation steps.
[00:01:09] Downloading python3 64 bit
[00:01:09]   from 'https://www.python.org/ftp/python/3.6.0/python-3.6.0-amd64.exe'
[00:01:09]
[00:01:09] Progress: 0% - Saving 26.78 KB of 30.05 MB (27420/31505640)
... *download info*
[00:01:10] Progress: 100% - Completed download of C:\Users\appveyor\AppData\Local\Temp\chocolatey\python3\3.6.0\python-3.6.0-amd64.exe (30.05 MB).
[00:01:10] Download of python-3.6.0-amd64.exe (30.05 MB) completed.
[00:01:13] Hashes match.
[00:01:13] Installing python3...
[00:01:51] ERROR: Running ["C:\Users\appveyor\AppData\Local\Temp\chocolatey\python3\3.6.0\python-3.6.0-amd64.exe" /quiet InstallAllUsers=1 PrependPath=1 TargetDir="C:\Python36" ] was not successful. Exit code was '1603'. See log for possible error messages.
[00:01:52] The install of python3 was NOT successful.
[00:01:52] Error while running 'C:\ProgramData\chocolatey\lib\python3\tools\chocolateyInstall.ps1'.
[00:01:52]  See log for details.
[00:01:54]
[00:01:54] python v3.6.0 [Approved]
[00:01:54] python package files install completed. Performing other installation steps.
[00:01:54]  The install of python was successful.
[00:01:54]   Software install location not explicitly set, could be in package or
[00:01:54]   default install location if installer.
[00:01:54]
[00:01:54] Chocolatey installed 1/2 packages. 1 packages failed.
[00:01:54]  See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
[00:01:54]
[00:01:54] Failures
[00:01:54]  - python3 (exited 1603) - Error while running 'C:\ProgramData\chocolatey\lib\python3\tools\chocolateyInstall.ps1'.
[00:01:54]  See log for details.
[00:01:54] 2016-03-28 11:31:39,117 [DEBUG] - Configured chocolatey.infrastructure.logging.log4net.config.xml from assembly choco, Version=0.9.9.12, Culture=neutral, PublicKeyToken=79d02ea9cad655eb
... *unrelated*

日志没有告诉我任何有用的信息。这是 Chocolatey 的错误,还是软件包的问题,或者希望是 VM 环境有问题?

python chocolatey appveyor
4个回答
3
投票

Python 3.6 已经安装在同一个

C:\Python36
位置:https://www.appveyor.com/docs/installed-software/#python


2
投票

安装程序返回

Exit code was '1603'
.


来自Microsoft文档

如果满足以下任一条件,您可能会收到此错误消息:

  • Windows Installer 正在尝试安装您的 PC 上已安装的应用程序。
  • 您尝试安装 Windows Installer 程序包的文件夹已加密。
  • 包含您尝试安装 Windows Installer 程序包的文件夹的驱动器作为替代驱动器访问。
  • SYSTEM 帐户对您尝试安装 Windows Installer 程序包的文件夹没有完全控制权限。您注意到错误消息是因为 Windows Installer 服务使用 SYSTEM 帐户安装软件。

最可能的错误原因是安装程序不是由具有所需权限的用户运行的。


1
投票

首先卸载所有 python 3 版本,然后使用 chocolatey 解决这个问题

chocolatey install python -y --force

0
投票

为了防止 chocolatey 以后尝试安装 python,您可以使用:

choco pin -n=python
© www.soinside.com 2019 - 2024. All rights reserved.