Open
Description
Put a PythonEngine and PythonEnvironment39 on a form with a memo + button
Set PythonEnvironment to e.g. c:\temp\python (making sure you create it first)
procedure TForm3.Button1Click(Sender: TObject);
begin
if PyEmbeddedResEnvironment391.Setup('3.9') then
begin
Memo1.Lines.Add('Setup returned True');
if PyEmbeddedResEnvironment391.Activate('3.9') then
Memo1.Lines.Add('Activate returned True')
else
Memo1.Lines.Add('Activate returned False');
end
else
Memo1.Lines.Add('Setup returned False');
end;
Output...
BeforeSetup
AfterSetup
Setup returned True
BeforeActivate
Activate returned False
Extra output is from event handlers on install, activate and ready and the target directory is still empty after the run
If I already have a Python in the directory then it's ignored - SharedLibrary and Executable are both empty causing InternalActivate to fail