2

I'm trying to run the simple tutorial examples with pyFMI package in Python but I get an error The FMU contains no binary for this platform. Tried to set the enviromental variables for the FMULibrary but the error is still here.

I would appreciate any hints.

runfile('C:/Users/NiPap/.spyder-py3/temp.py', wdir='C:/Users/d60378/.spyder-py3')
Could not find RADAR5
Could not find GLIMDA
Traceback (most recent call last):

   File "<ipython-input-1-b6c744d814b8>", line 1, in <module>
runfile('C:/Users/NiPap/.spyder-py3/temp.py', wdir='C:/Users/d60378/.spyder-py3')

   File "C:\Users\NiPap\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
execfile(filename, namespace)

   File "C:\Users\NiPap\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

   File "C:/Users/NiPap/.spyder-py3/temp.py", line 9, in <module>
fmi_bouncing_ball.run_demo()

  File "C:\Users\NiPap\AppData\Local\Continuum\anaconda3\lib\site-packages\pyfmi\examples\fmi_bouncing_ball.py", line 32, in run_demo
model = load_fmu(fmu_name)

 File "src\pyfmi\fmi.pyx", line 7157, in pyfmi.fmi.load_fmu (src\pyfmi\fmi.c:82903)

 File "src\pyfmi\fmi.pyx", line 2666, in pyfmi.fmi.FMUModelME1.__init__ (src\pyfmi\fmi.c:33458)

 File "src\pyfmi\fmi.pyx", line 943, in pyfmi.fmi.FMUModelBase.__init__ (src\pyfmi\fmi.c:14153)

FMUException: The FMU contains no binary for this platform.
NiPapen
  • 95
  • 1
  • 12
  • The .fmu file really is a zip file, and you can open it using e.g. 7-zip. Inside the archive there is a folder named binaries, and in there you will find the binaries. What do you see in there? – matth Jul 10 '18 at 14:07
  • I'm trying to simulate the examples included in the pyFMI (Bouncing_ball example) tutorial just to be sure that everything is working fine. When I open the examples in the pyfmi file there is no folder called binaries.Not sure how should I proceed – NiPapen Jul 10 '18 at 14:28
  • 1
    But did you do what I said? Open the bouncingBall.fmu using 7-zip, then there should a be folder binaries, and for me there are multiple directories inside the binaries directory (darwin32, darwin64, linux32, linux64, win32). – matth Jul 10 '18 at 15:03
  • You should tag this post with "fmi" and "pyfmi" – Christian Bertsch Jul 10 '18 at 19:32
  • 1
    Additional to matth's comment: on which target platform (windows/linux) do you want to simulate the FMU? Is it a 32/64 operating system? Is the Python you use 32bit or 64 bit? – Christian Bertsch Jul 10 '18 at 19:35
  • Just checked the pyfmi-2.4-py35_0 file installed with conda and there is no folder binaries : PyFMI-2.4.0\PyFMI-2.4\src\pyfmi\examples\files\FMUs\CS1.0 I have inside the bouncingBall.fmu I can't open. I'm using Windows 10 64-bit and Python 64-bit version. – NiPapen Jul 11 '18 at 06:58
  • 1
    The examples are not working but when I run my own generated simulations everything is fine... – NiPapen Jul 11 '18 at 08:26
  • To open the .fmu file, you can use either 7zip or you rename it to bouncingBall.zip and open it in Explorer. When I checked, it did contain several binaries, but not the win64 binary. – matth Jul 13 '18 at 11:03

1 Answers1

2

There are no 64 bit dlls within the example FMUs for the latest release of PyFMI. However, in coming releases there will be. Without the 64 bit dlls the FMU can not be simulated in a 64 bit environment.

are
  • 58
  • 5
  • I've tried both pyFMI v.2.3.1 and pyFMI v.2.4 and still getting the same exception with both of them! Can anyone, please, guide me to overcome this problem? – Moein Oct 31 '18 at 20:56
  • 2
    You can download a prebuilt version of PyFMI from https://jenkins.jmodelica.org/job/JM-trunk_chicago_pipeline/lastSuccessfulBuild/artifact/install/Python_64/pyfmi/ – are Nov 02 '18 at 07:35
  • Thanks @are for the answer. I'm pretty naive about using the pyFMI, can you please help me how exactly I can use the prebuild version that you provided? – Moein Nov 02 '18 at 14:01
  • 2
    Just make sure to add the path to the folder of PyFMI to environment variable PYTHONPATH and it should work out of the box. – are Nov 05 '18 at 08:05