Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork320
Using the library in a Windows service. Is that possible ?#487
-
If I try to create an instance of TPythonEngine in a 64 bit Windows service, if the AutoLoad property is set to True the service does not start. |
BetaWas this translation helpful?Give feedback.
All reactions
When you run as a service the registry information is not available. You need to do something like:
procedure TService1.CreatePyEngine;
begin
PythonEngine := TPythonEngine.Create(nil);
PythonEngine.Name := 'PythonEngine';
PythonEngine.DLLName := 'python313.dll';
PythonEngine.DllPath := 'c:\pathtoyourpythonhome';
PythoneEngine.PythonHome := PythonEngine.DLLPath;
PythonEngine.RegVersion := '3.13';
PythonEngine.UseLastKnownVersion := False;
PythonEngine.FatalAbort := False;
PythonEngine.FatalMsgDlg := False;
PythonEngine.LoadDll;
end;
I have tested and it works.
Replies: 2 comments 1 reply
-
I don't know. But I don't see why not. However AutoLoad is relevant when using visual components in a form. You will have to create the components and load the dll manually. |
BetaWas this translation helpful?Give feedback.
All reactions
-
Thank you for your replay.
|
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
When you run as a service the registry information is not available. You need to do something like: procedure TService1.CreatePyEngine; I have tested and it works. |
BetaWas this translation helpful?Give feedback.