1@echo off 2set "VIRTUAL_ENV=__VENV_DIR__" 3 4if not defined PROMPT ( 5 set "PROMPT=$P$G" 6) 7 8if defined _OLD_VIRTUAL_PROMPT ( 9 set "PROMPT=%_OLD_VIRTUAL_PROMPT%" 10) 11 12if defined _OLD_VIRTUAL_PYTHONHOME ( 13 set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%" 14) 15 16set "_OLD_VIRTUAL_PROMPT=%PROMPT%" 17set "PROMPT=__VENV_PROMPT__%PROMPT%" 18 19if defined PYTHONHOME ( 20 set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%" 21 set PYTHONHOME= 22) 23 24if defined _OLD_VIRTUAL_PATH ( 25 set "PATH=%_OLD_VIRTUAL_PATH%" 26) else ( 27 set "_OLD_VIRTUAL_PATH=%PATH%" 28) 29 30set "PATH=%VIRTUAL_ENV%\__VENV_BIN_NAME__;%PATH%" 31 32:END 33