J2897 icon

Python Module Upgrader - Admin

J2897 | PRO | 09/25/21 02:33:27 PM UTC (Edited) | 0 ⭐ | 1173 👁️ | Never ⏰ | []
Batch |

820 B

|

None

|

0 👍

/

0 👎

@echo OFF
title Python Module Upgrader (Admin)
 
:: This will upgrade all the modules in the GLOBAL environment.
::
:: You can run this after installing the Chocolatey version of Python, or before
:: setting up a new Python virtual environment with 'venv'.
 
REM Do OPENFILES to check for administrative privileges.
openfiles >nul 2>&1
if errorlevel 1 (
    color cf
    echo Right-click on this file and select "Run as administrator".
    pause
    color
    exit /b 1
)
 
REM Upgrade PIP.
python -m pip install --upgrade pip
 
REM Upgrades all of Python's PIP packages, presuming PIP is installed.
for /F "delims==" %%A in ('python -m pip list --format freeze') do (
    REM Package name to skip and exclude from upgrading.
    if not "%%A" == "pip" (
        REM Upgrade package.
        python -m pip install --upgrade %%A
    )
)
echo.
pause

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎