DelphiFMX4Python icon indicating copy to clipboard operation
DelphiFMX4Python copied to clipboard

Exe problem

Open limelect opened this issue 2 years ago • 19 comments

Plz see https://en.delphipraxis.net/topic/10675-d4p_export_demo/ Either VCL or FMX cannot make an EXE with pyinstaller.exe On GUIPY the script runs with no problem

limelect avatar Dec 18 '23 08:12 limelect

@limelect you will find further instructions here. Let me know if this works for you.

lmbelo avatar Dec 19 '23 12:12 lmbelo

No, However in GUIPY it workes G:\Delphi Projects\Embarcadero\Delphi4PythonExporter-main\installer>pyinstaller delphifmxexecutable.spec

The 'pathlib' package is an obsolete backport of a standard library package and is incompatible with PyInstaller. Please remove this package (located in c:\user s\limelect\anaconda3\lib\site-packages) using conda remove then try again.

Am I to delete and install again? with pip install? I do not remember how I installed

delphifmxexecutable.py.txt delphifmxexecutable.spec.txt it did not work

limelect avatar Dec 19 '23 15:12 limelect

I am missing some ting where is the source name and location is it the delphifmx?

limelect avatar Dec 19 '23 15:12 limelect

Simplify your test case... Install Python3.11, PyInstaller and DelphiFMX out of Conda and try again.

lmbelo avatar Dec 19 '23 15:12 lmbelo

Is it supposed to be like that? still same mistak

delphifmxexecutable.spec.txt

?

limelect avatar Dec 19 '23 15:12 limelect

I see on the net an answer

https://stackoverflow.com/questions/75476135/how-to-convert-python-file-to-exe-the-pathlib-package-is-an-obsolete-backport

I've experienced the same problem. I managed to solve it by downgrading pyInstaller to 5.1 (from 5.8) without touching pathlib. An additional possibility to consider.

from the net pip install pyinstaller==5.1 do I do that

limelect avatar Dec 19 '23 15:12 limelect

Try it on Python3.11 as I said.

lmbelo avatar Dec 19 '23 15:12 lmbelo

someting happened tp PyInstaller

limelect avatar Dec 19 '23 16:12 limelect

First i deleted the dir problem pyinstaller workers now it compile BUt

  1. where is the name of my program? in the spec?
  2. or I do not understand. i need an execute of my program

limelect avatar Dec 19 '23 16:12 limelect

Ok I found the program name BUt G:\Delphi Projects\Embarcadero\Delphi4PythonExporter-main\installer\dist\delphif mxexecutable>delphifmxexecutable.exe Traceback (most recent call last): File "D4P_export_demo.py", line 13, in File "D4P_export_demo.py", line 7, in main File "parent_window.py", line 12, in init SystemError: <built-in method LoadProps of Parent_Form object at 0x02A4A070> ret urned NULL without setting an error [16136] Failed to execute script 'D4P_export_demo' due to unhandled exception!

I will check it with VCL

limelect avatar Dec 19 '23 16:12 limelect

Finaly it workes on VCL

limelect avatar Dec 19 '23 16:12 limelect

But on FMX Error this is the project Delphi4PythonExporter-main\Samples\Simple_Demo

limelect avatar Dec 19 '23 16:12 limelect

Pythone.zip Still something very wrong on vcl I get an empty form Screenshot - 19_12_2023 , 19_58_36

delphivclexecutable.spec.txt

Screenshot - 19_12_2023 , 19_52_38

limelect avatar Dec 19 '23 17:12 limelect

Make sure your script is getting the right path to the .pydfm file.

lmbelo avatar Dec 19 '23 18:12 lmbelo

I made sure as I am a professional I do not have any (on my 3 vcl demo) just an empty screen P.S My site www.limelect.com with Delphi since Delphi #1

limelect avatar Dec 19 '23 20:12 limelect

Hmm... I didn't get the point.

Anyway, I quick fixed your project and shared it here again.

Pythone.zip

lmbelo avatar Dec 19 '23 21:12 lmbelo

Finally, it works great thanks can you only explain to me the datas= fields? For the first 2, I understand the path to the library and the library name of the others. if I have more forms will this be included I guess each form has this structure r"Unit1.pydfm". and lastly the point what does it mean?

As for FMX, I will try to play with it as it has a problem too

I could not find any good information on data here https://pyinstaller.org/en/stable/man/pyi-makespec.html

And lastly, why do I have to give the package path and name? it does not know where the Pythone packages are?

limelect avatar Dec 20 '23 06:12 limelect

why the last comment go into our discussion?

limelect avatar Dec 20 '23 09:12 limelect

First Thanks for your kind help But unfortunately, I have some bad comments which do not concern you

  1. I did not get any action with the exe button pressed edit>label
  2. If so Delphivcl has no preference over QT designer which does the same
  3. with my https://limelect.com/downloads/compile-ui-to-py-files/ compile UI>py PYinstaler is used very simply and does the same job
  4. I hope Embarcadero will read this and take some action with their PY output
  5. I have added a test program
  6. if I am wrong about the output plz notify me

my_vcl_test.zip

limelect avatar Dec 21 '23 08:12 limelect