Jump to content
Jaime Florian

Error 87: Could not open Dll "python38.dll"

Recommended Posts

Hello,

 

I have been developing a Windows desktop application using Delphi 10.3 and Python4Delphi. I have a python 3.8 embeddable version in a subfolder called "python" inside of the Release folder of my app, I used to be able to load the python dll from there setting the DllPath and SetPythonHome properties to "python". I recently moved to a new computer and reinstalled Delphi and the Python4Delphi latest version, and now I'm being thrown the error "Error 87: Could not open Dll "python38.dll"" with the same project. Using the full windows path from the folder "C:\...\python" works, so maybe something has changed when it comes to loading python from a subfolder? I hope this can be fixed.

 

Thanks.

Share this post


Link to post

The DLLPath was always meant to be the full path to the DLL.  If it worked it was by accident rather than by design.

 

Why don't you just use:

PythonEngine.DllPath  := TPath.Combine(ExtractFilePath(Application.ExeName), 'Python')  

 

in the OnBeforeLoad event for instance?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×