Skip to content

Instantly share code, notes, and snippets.

@mark05e
Last active November 2, 2023 02:46
Show Gist options
  • Save mark05e/8d05c4e30ee68fe7e52afba11b936756 to your computer and use it in GitHub Desktop.
Save mark05e/8d05c4e30ee68fe7e52afba11b936756 to your computer and use it in GitHub Desktop.
script to download, extract and setup pip using embeddable python package. tested on win10
set PY_URL=https://www.python.org/ftp/python/3.9.5/python-3.9.5-embed-amd64.zip
mkdir c:\python
cd /d c:\python
:: Download & extract python
curl %PY_URL% -o python-embed.zip
Powershell Expand-Archive -Force python-embed.zip C:\python
:: Install pip
curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
python get-pip.py
:: Set Environment Variables
set PY_EXE=%CD%
set PY_PIP=%CD%\Scripts
set PY_LIB=%CD%\Lib;%CD%\Lib\site-packages
set PATH=%PY_EXE%;%PY_PIP%;%PY_LIB%;%PATH%
:: Workaround to get PIP to work
rename *._pth *._pth.backup
:: Check versions
python --version
python -m pip --version
pip list -v
timeout 50
:: Setup VirtualEnv
:: pip install --force-reinstall virtualenv
:: mkdir DLLs
@mark05e
Copy link
Author

mark05e commented May 23, 2021

path variable is only set on the script. update it to include the /M switch and run this as admin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment