Skip to content

PythonFMU with NumPy #152

@mariuszjaniakpl

Description

@mariuszjaniakpl

Hello,

We have noticed that, when trying to wrap some simple Python model which depends on NumPy we get following error

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.9 from "/opt/ws/src/code/cosim_tools/omsimulator/build/PythonFMU"
  * The NumPy version is: "1.22.3"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: /usr/local/lib/python3.9/dist-packages/numpy/core/_multiarray_umath.cpython-39-x86_64-linux-gnu.so: undefined symbol: PyObject_SelfIter

just after importing NumPy at the begging of the Python script

from pythonfmu import Fmi2Causality, Fmi2Slave, Real
try:
    import numpy
except ImportError as e:
    print(e)

Have any of you encounter similar problem before?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions