Skip to content

Instantly share code, notes, and snippets.

@itoleck
Last active May 17, 2024 23:10
Show Gist options
  • Save itoleck/e186c57a091f033e450e6e95d843aff6 to your computer and use it in GitHub Desktop.
Save itoleck/e186c57a091f033e450e6e95d843aff6 to your computer and use it in GitHub Desktop.
Install python
#Install Python Windows store version
choco install python
#Install pyenv-win
Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1"
#Setup env vars and path
[System.Environment]::SetEnvironmentVariable('PYENV',$env:USERPROFILE + "\.pyenv\pyenv-win\","User")
[System.Environment]::SetEnvironmentVariable('PYENV_ROOT',$env:USERPROFILE + "\.pyenv\pyenv-win\","User")
[System.Environment]::SetEnvironmentVariable('PYENV_HOME',$env:USERPROFILE + "\.pyenv\pyenv-win\","User")
[System.Environment]::SetEnvironmentVariable('path', $env:USERPROFILE + "\.pyenv\pyenv-win\bin;" + $env:USERPROFILE + "\.pyenv\pyenv-win\shims;" + [System.Environment]::GetEnvironmentVariable('path', "User"),"User")
Set-Alias -Name pyenv-win -Value pyenv
#Test install
pyenv --version
pyenv-win --version
#List Python versions
pyenv install -l
#Install 3.10.6 for Stable Diffusion
pyenv install 3.10.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment