J. Robroeks 1 Posted March 1, 2021 Hi, I'm trying to get started with the python4delphi with Ubuntu 18.04 on Subsytem for Windows. But I always receive the error: Could not open DLL "libpython3.3m.so". What I've tried so far: Downloaded the packages via Git on 26-2 Installation did trow errors of unavailable packages. I finally build the non-dcl projects again and installed the dcl as 'Explicit rebuild'. (I don't know whether it had something to do with the $(auto).bpl suffix). Building and Running Demo project files for 32 bits Windows. (works) Building and deploying for 64 bit Linux (works) Installing Python 3.8 via get-apt and tested it via CLI (works) Running Python commands in Ubuntu after installation via get-apt (works) Changing the standard python verison on ubuntu to 3. (works, even though this is not recommended) Located the .so file via locate libpython3. Changed the PythonEnging paths and DLL's accordingly. (no succes) Result: /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1 /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0 /usr/lib/config-3.6m-x86_64-linux-gnu/libpython3.6.so /usr/lib/config-3.6m-x86_64-linux-gnu/libpython3.6m.so I don't know why the 3.8 .so files are not found. Searching for Linux examples, but only found one for Lazarus. But I think I've overlooked something here. (I tried the source, bit without luck) I've changed the DLL name to several different versions. libpython3.8m.so, libpython3.8.so and even older 2.7 versions. (No luck) Played with several PythonEngine settings, such as uselastknownversion, redirect IO, Autoload etc. Changing dllpaths. (No luck) The project file so far as Console application: PythonEngine1:= TPythonEngine.Create(nil); PythonInOut := TPythonInputOutput.Create(nil); try PythonEngine1.IO := PythonInOut; PythonEngine1.DllName := 'libpython3.6m.so'; PythonEngine1.AutoLoad := true; PythonEngine1.DllPath := '/usr/lib/x86_64-linux-gnu/'; PythonEngine1.AutoFinalize := true; PythonEngine1.AutoLoad := true; PythonEngine1.AutoUnload := true; PythonEngine1.RedirectIO := true; PythonEngine1.UseLastKnownVersion := true; PythonEngine1.Loaddll; finally PythonEngine1.Free; PythonInOut.Free; end; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; Is there anyone who knows what I'm doing wrong here? Is it probably my Delphi environment, or Ubunut? Kind regards, Jan Share this post Link to post
J. Robroeks 1 Posted March 1, 2021 The scripter works after installing python3.8-venv when setting the dllname to 'libptyhon3.6m.so.1.0'. The libptyhon3.8 files are neither found via p4d nor via locate libpython3. So there must be still an issue with sharing the 3.8 version on ubuntu. Installation command: sudo apt-get install python3.8-venv https://dev.to/mortoray/how-to-install-python-3-8-on-ubuntu-1bp4 Share this post Link to post
Virgo 18 Posted March 1, 2021 If UseLastKnownVersion is True, then try installing also libpython3.X-dev package. Or set UseLastKnownVersion to false and assign DllPath and DllName Share this post Link to post
FranzB 0 Posted March 14, 2021 working also on this topic, and need to find out how get the correct settings on different UNIX system, I started from your code and did this code now : Share this post Link to post
pyscripter 689 Posted March 16, 2021 (edited) On 3/1/2021 at 9:18 AM, J. Robroeks said: Installation did throw errors of unavailable packages The installations issues are probably due to the fact that you are using Delphi 10.4 (is this the case?). Please upgrade to Delphi 10.4.1 or better to 10.4.2 Edited March 16, 2021 by pyscripter Share this post Link to post