Q: Run some functions after activating virtual environment from the same script contain the function I need to run some functions after activating the virtual environment.
I want to activate the virtual env from the same script which is containing the functions.
I am using the following code :
if 'VUNET_VIRT_ENV' in os.environ:
            VUNET_VIRT_ENV = os.environ['VUNET_VIRT_ENV']
else:
    VUNET_VIRT_ENV = '/home/ubuntu/workspace/vunetenv/'
    
VIRTENV_ACTIVATE_FILE = VUNET_VIRT_ENV + 'bin/activate_this.py'

exec(compile(open(VIRTENV_ACTIVATE_FILE).read(),
             VIRTENV_ACTIVATE_FILE,
             'exec'))

I am getting the following error while running the script:
Command '' returned non-zero exit status 1

there is activate_this.py in the defined location. But I can't figure out what went wrong? I am running in Linux.
