Skip to content

Instantly share code, notes, and snippets.

@yujp
Last active June 29, 2021 00:54
Show Gist options
  • Save yujp/d2a3418813da9d0568de50813ecfafd6 to your computer and use it in GitHub Desktop.
Save yujp/d2a3418813da9d0568de50813ecfafd6 to your computer and use it in GitHub Desktop.

Installing Portable Python on Windows10

Open PowerShell and execute the code below:

Invoke-WebRequest -Uri "https://www.python.org/ftp/python/3.9.6/python-3.9.6-embed-amd64.zip" -OutFile "python.zip"
Expand-Archive -Path python.zip -DestinationPath python
Remove-Item python.zip

cd python
(Get-Content .\python39._pth) | %{ $_ -replace "#import site","import site" } | Set-Content .\python39._pth

Invoke-WebRequest -Uri "https://bootstrap.pypa.io/get-pip.py"  -OutFile "get-pip.py"
.\python.exe get-pip.py
Remove-Item get-pip.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment