startup problem on internal production system of Delta Barth #33

Closed
opened 2025-05-28 13:31:27 +00:00 by foefl · 7 comments
Owner

error because of NumPy import which does not seem to be possible

Python.Runtime.PythonException: Unable to import required dependencies:

numpy: Error importing numpy: you should not try to import numpy from

        its source directory; please exit the numpy source tree, and relaunch

        your python interpreter from there.

  File "C:\Program Files (x86)\DELECO\ERP Server\extern\dopt\python\Lib\site-packages\pandas\__init__.py", line 32, in <module>

    raise ImportError(

  File "C:\Program Files (x86)\DELECO\ERP Server\extern\dopt\python\Lib\site-packages\delta_barth\types.py", line 9, in <module>

    import pandas as pd

  File "C:\Program Files (x86)\DELECO\ERP Server\extern\dopt\python\Lib\site-packages\delta_barth\constants.py", line 10, in <module>

    from delta_barth.types import DualDict, HttpContentHeaders

  File "C:\Program Files (x86)\DELECO\ERP Server\extern\dopt\python\Lib\site-packages\delta_barth\management.py", line 8, in <module>

    from delta_barth.constants import HTTP_BASE_CONTENT_HEADERS

   at Python.Runtime.PythonException.ThrowLastAsClrException()

   at Python.Runtime.NewReferenceExtensions.BorrowOrThrow(NewReference& reference)

   at Python.Runtime.PyModule.Import(String name)

   at Python.Runtime.Py.Import(String name)

   at dopt.DeltaBarth.Plugin..ctor(String runtimePath)
error because of NumPy import which does not seem to be possible ``` Python.Runtime.PythonException: Unable to import required dependencies: numpy: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python interpreter from there. File "C:\Program Files (x86)\DELECO\ERP Server\extern\dopt\python\Lib\site-packages\pandas\__init__.py", line 32, in <module> raise ImportError( File "C:\Program Files (x86)\DELECO\ERP Server\extern\dopt\python\Lib\site-packages\delta_barth\types.py", line 9, in <module> import pandas as pd File "C:\Program Files (x86)\DELECO\ERP Server\extern\dopt\python\Lib\site-packages\delta_barth\constants.py", line 10, in <module> from delta_barth.types import DualDict, HttpContentHeaders File "C:\Program Files (x86)\DELECO\ERP Server\extern\dopt\python\Lib\site-packages\delta_barth\management.py", line 8, in <module> from delta_barth.constants import HTTP_BASE_CONTENT_HEADERS at Python.Runtime.PythonException.ThrowLastAsClrException() at Python.Runtime.NewReferenceExtensions.BorrowOrThrow(NewReference& reference) at Python.Runtime.PyModule.Import(String name) at Python.Runtime.Py.Import(String name) at dopt.DeltaBarth.Plugin..ctor(String runtimePath) ```
foefl added the
bug
label 2025-05-28 13:31:27 +00:00
foefl self-assigned this 2025-05-28 13:31:27 +00:00
foefl added this to the bug fixes project 2025-05-28 13:31:27 +00:00
Author
Owner

currently digging into this topic with Delta Barth:

  • maybe OS- or processor-related
  • runtime folder might not be reachable
currently digging into this topic with Delta Barth: - maybe OS- or processor-related - runtime folder might not be reachable
Author
Owner

system specs for production system:

  • Betriebssystem: Microsoft Windows Server 2022 Standard
  • Runtime: .NET 8.0.15
  • Prozessor: Intel(R) Xeon(R) CPU E5-2637 v4 @ 3.50GHz
  • Arbeitsspeicher: 7 GB
system specs for production system: - Betriebssystem: Microsoft Windows Server 2022 Standard - Runtime: .NET 8.0.15 - Prozessor: Intel(R) Xeon(R) CPU E5-2637 v4 @ 3.50GHz - Arbeitsspeicher: 7 GB
Author
Owner
  • make debug build with other routine which looks for needed environment variables
- make debug build with other routine which looks for needed environment variables
foefl moved this to In Progress in bug fixes on 2025-06-18 04:52:11 +00:00
Author
Owner

state 16.06.2025

  • local execution working, on test system not
  • Delta Barth even tried to make their own small plugin with "pythonnet" --> same errors: working on local system, not test system

error message related to NumPy:

DLL load failed while importing _multiarray_umath

*state 16.06.2025* - local execution working, on test system not - Delta Barth even tried to make their own small plugin with "pythonnet" --> same errors: working on local system, not test system error message related to NumPy: `DLL load failed while importing _multiarray_umath`
foefl pinned this 2025-06-18 05:02:20 +00:00
Author
Owner

update on 18.06.2025

Plugin is now working. Latest MS Visual C++ Redist package had to be installed on the system: https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

*update on 18.06.2025* Plugin is now working. Latest MS Visual C++ Redist package had to be installed on the system: [https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 )
foefl closed this issue 2025-06-18 08:53:13 +00:00
foefl moved this to Done in bug fixes on 2025-06-18 08:53:24 +00:00
Author
Owner

Delta Barth does not want to install runtimes on their customers' servers.The problem can be fixed by placing the VC-Runtime DLL in the numpy.lib folder, because this is how Python loads external linked native DLL dependencies on Windows.

It is no valid option because there is no clear limit on how many times this DLL needs to be copied in the future, especially for other projects. There is always a risk that a possible import error is missed and the program does not work properly at runtime. Therefore it seems better to enable the Python interpreter to load the needed dependencies from the system's search path.

For more information see the related issue for the base C#-Lib: dopt-SharpPython/dopt-SharpPython#9

Delta Barth does not want to install runtimes on their customers' servers.The problem can be fixed by placing the VC-Runtime DLL in the `numpy.lib` folder, because this is how Python loads external linked native DLL dependencies on Windows. It is no valid option because there is no clear limit on how many times this DLL needs to be copied in the future, especially for other projects. There is always a risk that a possible import error is missed and the program does not work properly at runtime. Therefore it seems better to enable the Python interpreter to load the needed dependencies from the system's search path. For more information see the related issue for the base C#-Lib: dopt-SharpPython/dopt-SharpPython#9
foefl reopened this issue 2025-06-25 05:23:27 +00:00
foefl moved this to In Progress in bug fixes on 2025-06-25 05:25:45 +00:00
Author
Owner

Feedback on 27.06.25: The import is now working without copying DLLs to NumPy's lib folder.

*Feedback on 27.06.25*: The import is now working without copying DLLs to NumPy's lib folder.
foefl closed this issue 2025-06-27 13:24:20 +00:00
foefl moved this to Done in bug fixes on 2025-06-27 13:24:31 +00:00
foefl unpinned this 2025-06-27 13:45:36 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: delta-barth/delta-barth-py#33
No description provided.