I am using Delphi 10.4 to invoke a python script using the Py4Delphi library.
How can I execute the script with respect to a particular python virtual environment directory?
CodePudding user response:
Using the virtual environment is basically setting a few environment variables before running python. You can look into scripts\activate.bat which variables that are.
You don't need to recover those changes after running it, because within a process you're running with a copy of the system environment.