Created
March 16, 2025 13:08
-
-
Save Xarkam/d34aed759106b1cfbb6003ae47e44c0e to your computer and use it in GitHub Desktop.
Prepare downloaded python zip for obs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$currentPath = Get-Location | |
# Rename the file python312._pth to python312._pth.save to prevent malfunction | |
Rename-Item Path "$currentPath\python312._pth" -NewName "$currentPath\python312._pth.save" | |
#Get pip from https://bootstrap.pypa.io/get-pip.py | |
$url="https://bootstrap.pypa.io/get-pip.py" | |
$output="$currentPath\get-pip.py" | |
Invoke-WebRequest -Uri $url -OutFile $output | |
# Set python path | |
# This script sets the PYTHONPATH volatile environment variable to include the current directory and its subdirectories | |
# This script should be run from the directory containing the portable Python distribution | |
# This script should be run in the PowerShell command line | |
$portablePythonPath = "$currentPath | |
$currentPath\Scripts; | |
$currentPath\DLLs; | |
$currentPath\lib; | |
$currentPath\lib\plat-win; | |
$currentPath\lib\site-packages; | |
$currentPath\Libs" | |
write-host "Setting PYTHONPATH to $portablePythonPath" | |
Set-Variable PYTHONPATH $portablePythonPath -Option Volatile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment