install-windows-python3.ps1 850 B

12345678910111213141516171819202122
  1. <#
  2. Copyright (c) Contributors to the Open 3D Engine Project.
  3. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. SPDX-License-Identifier: Apache-2.0 OR MIT
  5. #>
  6. Write-Host "Install Python"
  7. choco install -y python3 --version=3.10.11
  8. $pyroot = "C:\Python310"
  9. Write-Host "Ensure Python paths are set"
  10. [Environment]::SetEnvironmentVariable(
  11. "PATH",
  12. [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) + ";$pyroot;$pyroot\Scripts",
  13. [EnvironmentVariableTarget]::Machine)
  14. Write-Host "Installing packages" # requirements.txt hould be in the "Platforms\Common" folder
  15. pip3 install -r "$pwd\requirements.txt"
  16. New-Item -ItemType SymbolicLink -Path "$pyroot\python3.exe" -Target "$pyroot\python.exe" # The Jenkins scripts use `python3` (as with linux) for python calls