Last active
November 2, 2023 02:46
-
-
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
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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
path variable is only set on the script. update it to include the
/M
switch and run this as admin