FranzB 0 Posted March 13, 2021 uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation, FMX.ScrollBox, FMX.Memo, FMX.StdCtrls, System.SyncObjs, FMX.Memo.Types, FMX.ListBox, System.IniFiles, PythonEngine, PythonVersions; var PyVersion: TPythonVersion; begin FPyVersions := GetRegisteredPythonVersions; for PyVersion in FPyVersions do cbb_Pyversions.Items.Add(PyVersion.DisplayName); if cbb_Pyversions.Items.Count > 0 then begin cbb_Pyversions.ItemIndex := 0; end; end; I failed to compile above code for LINUX OS, is there any workaround in the UNIX platform ? Share this post Link to post
pyscripter 689 Posted March 14, 2021 The PythonVersions unit is of little value in Linux, where there is no Registry and no registered Python versions. You need to manually provide the DLLName and DLLPath. You can use some code that searches possible file locations. For example in the Mac you can do, something like: {$ifdef MACOS} for N:= 5 to 9 do begin S:= Format('/Library/Frameworks/Python.framework/Versions/3.%d/lib/libpython3.%d.dylib', [N, N]); if FileExists(S) then exit(S); end; {$endif} In Debian Linux you can search for file locations such as: /usr/lib/x86_64-linux-gnu/libpython3.7m.so /usr/lib/x86_64-linux-gnu/libpython3.7m.so.1 /usr/lib/x86_64-linux-gnu/libpython3.7m.so.1.0 but it may vary by python distribution. 1 Share this post Link to post
FranzB 0 Posted April 19, 2021 (edited) what is the correct path setting for using python4delphi with UBUNTU ? can I get a parameter recommendation Edited April 19, 2021 by FranzB Share this post Link to post