Skip to content
pyscripter edited this page Apr 15, 2020 · 3 revisions

Masking FPU Exceptions

Delphi raises an exception when floating operations result produce +/- infinity (e.g. division by zero). This setting is not compatible with a number of Python libraries such as numpy and scipy.

Python for Delphi provides a procedure MaskFPUExceptions that can help resolve such issues. If you get errors when using python libraries you make want to take the following steps:

  • Set the PythonEngine AutoLoad property to False.
  • In your FormCreate event handler or in some other suitable place do:
    • MaskFPUExceptions(True)
    • PythonEngine.LoadDLL

See also How Python for Delphi finds your Python distribution for information about PythonEngine properties that affect the loading of Python.

Clone this wiki locally