pyenv-virtualenv for Windows 1.2
A 'pyenv' plugin to manage Python virtual environments, depending on different Python versions, for various Python projects.
Loading...
Searching...
No Matches
pyenv-virtualenv-init.bat
Go to the documentation of this file.
1@echo off
2setlocal
3REM Windows Command Line Script (Batch) to launch "pyenv-virtualenv-init.py".
4REM
5REM Dependencies:
6REM * pyenv
7REM * pyenv-virtualenv
8REM
9REM © 2025 Michael Paul Korthals. All rights reserved.
10REM For legal details see documentation.
11REM
12REM 2025-07-11
13REM
14REM This script is located in the subfolder "bin"
15REM in the project main directory.
16REM
17REM Simply open it in Windows Explorer or call it by path
18REM in the Windows CMD terminal.
19REM
20REM The script returns RC = 0 or another value in case of
21REM error.
22
23REM This job is too challenging for Windows CMD language.
24REM Calling python script to bypass all the painful CMD problems.
25REM Using the Python version, which is globally set by "pyenv".
26call python "%~dp0pyenv-virtualenv-init.py" %*
27set /a RC=%ERRORLEVEL%
28if %RC% equ 130 goto cancel
29if %RC% equ 5 goto finish
30if %RC% neq 0 goto error1
31endlocal
32exit /b 0
33REM Display error messages
34:error1
35echo.
36echo ␛[91mERROR: Failed to initialize terminal shell (RC = %RC%).␛[0m
37echo ␛[37mINFO: Check if Python, "pyenv" and plugin "pyenv-virtualenv" are correctly installed/configured.␛[0m
38endlocal
39exit /b 1
40REM Cancel program silently
41:cancel
42endlocal
43exit /b 130
44REM Ignore I/O error, but return it
45:finish
46endlocal
47exit /B 5