Files
picard/scripts/win-update-python.ps1
Philipp Wolfer d1485ea491 Appveyor: Convert Python install script to PowerShell
Also install Python only if not already on wanted version
2019-02-11 22:57:08 +01:00

14 lines
640 B
PowerShell

$CurrentVersion = python -c "import sys; print('%s.%s.%s' % sys.version_info[0:3])"
Write-Output "Python installed: $CurrentVersion, wanted: $env:PYTHON_VERSION"
if ($CurrentVersion -ne $env:PYTHON_VERSION) {
$InstallerUrl = 'https://www.python.org/ftp/python/' + $env:PYTHON_VERSION + '/python-' + $env:PYTHON_VERSION + '-amd64.exe'
Write-Output "Downloading and installing $InstallerUrl..."
(new-object net.webclient).DownloadFile($InstallerUrl, 'python-amd64.exe')
python-amd64.exe /quiet InstallAllUsers=1 TargetDir=%PYTHON% Include_doc=0 Include_tcltk=0 Include_test=0
python -m ensurepip
}
python --version
pip3 --version