Skip to content

Instantly share code, notes, and snippets.

@itoleck
Last active May 17, 2024 23:10
Show Gist options
  • Select an option

  • Save itoleck/e186c57a091f033e450e6e95d843aff6 to your computer and use it in GitHub Desktop.

Select an option

Save itoleck/e186c57a091f033e450e6e95d843aff6 to your computer and use it in GitHub Desktop.

Revisions

  1. itoleck revised this gist May 17, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Install python.ps1
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    #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"
  2. itoleck renamed this gist May 17, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. itoleck renamed this gist May 17, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. itoleck created this gist May 17, 2024.
    21 changes: 21 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #Install Python Windows store version

    #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