[TRNSYS-users] Type169 strange behaviour...

LECONTE Antoine 219492 Antoine.LECONTE at cea.fr
Wed May 29 09:10:23 PDT 2019


Hello,

I am struggling using correctly Type169 “Calling Python Script”.

In order to use our former homemade Types, I am using TRNSYS18 32bits.
I have re-compiled Type169 in 32bits with Microsoft Visual C++ Express 2010 and Python 3.5 (I did not succeed with more recent version of Python3).

I have first created a test project in “TRNSYS18/MyProjects” folder, using this type and it works perfectly.

But if I copy/paste the exact same project folder – with the exact same Python script – on another computer with the same configuration or even on my Desktop folder, I have most of the time the following error “The Python script failed to load”.
And sometimes, depending on where I try to run the simulation, I have the error : "Failed to load the function…” (while the function name is correctly written).

When looking at the Type169.cpp code in Debug mode, it seems that the problem comes from the “PyImport_Import” function.
Arguments in previous functions seem correct in any case (scriptPath and scriptName). But in problematic cases, the function returns an empty object (pModule).
And I can’t go further with my limited knowledge of Python.

Has anyone encountered such a problem ?

Best regards,

Antoine Leconte
------------------------------------------------------------------------------------------
tel. +33(0)479792138 – CEA INES ☼ – LITEN/DTS/SBST/LSTB –  Le Bourget du Lac (73), FRANCE – bât. HELIOS/3117 Liten.cea.fr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20190529/326d1c8e/attachment.html>


More information about the TRNSYS-users mailing list