Issue with activating virtual environment through batch file

Viewed 27

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?

0 Answers
Related