1

I am trying to activate a virtual environment using a batch file in Windows, but it isn't working. This is the script that I'm using:

@ECHO OFF
ECHO Activating the virtual environment
ECHO ===================================
ECHO current directory: %CD%
ECHO ====================================
CALL %CD%\virt_test\Scripts\activate
ECHO current directory: %CD%
ECHO ====================================
ECHO Check activation virtual environment
python VerifyVirtEnv.py

and here VerifyVirtEnv.py verifies whether the virtual environment has been activated using sys.prefix and sys.base_prefix.

Activating the virtual environment does work directly from powershell, but why isn't it working like this?

Compo
  • 36,585
  • 5
  • 27
  • 39
C. Elias
  • 11
  • 2

0 Answers0