Numpy import error

Coreform Cubit Version: 2024.8
Platform: Fedora Core 41 (upto date)

When trying to import numpy I get a stream of errors, Its a bit of an issue as an upstream package I would like to use, also uses numpy and importing this causes issues.

/opt/Coreform-Cubit-2024.8/bin/python3/lib/python3.10/site-packages/networkx/drawing/nx_pylab.py:105: in draw
    import matplotlib.pyplot as plt
/opt/Coreform-Cubit-2024.8/bin/python3/lib/python3.10/site-packages/matplotlib/__init__.py:108: in <module>
    import numpy
/opt/Coreform-Cubit-2024.8/bin/python3/lib/python3.10/site-packages/numpy/__init__.py:144: in <module>
    from . import core
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    """
    Contains the core of NumPy: ndarray, ufuncs, dtypes, etc.
    
    Please note that this module is private.  All functions and objects
    are available in the main ``numpy`` namespace - use that instead.
    
    """
    
    from numpy.version import version as __version__
    
    import os
    import warnings
    
    # disables OpenBLAS affinity setting of the main thread that limits
    # python threads or processes to one core
    env_added = []
    for envkey in ['OPENBLAS_MAIN_FREE', 'GOTOBLAS_MAIN_FREE']:
        if envkey not in os.environ:
            os.environ[envkey] = '1'
            env_added.append(envkey)
    
    try:
        from . import multiarray
    except ImportError as exc:
        import sys
        msg = """
    
    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: Python%d.%d from "%s"
      * The NumPy version is: "%s"
    
    and make sure that they are the versions you expect.
    Please carefully study the documentation linked above for further help.
    
    Original error was: %s
    """ % (sys.version_info[0], sys.version_info[1], sys.executable,
            __version__, exc)
>       raise ImportError(msg)
E       ImportError: 
E       
E       IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
E       
E       Importing the numpy C-extensions failed. This error can happen for
E       many reasons, often due to issues with your setup or how NumPy was
E       installed.
E       
E       We have compiled some common reasons and troubleshooting tips at:
E       
E           https://numpy.org/devdocs/user/troubleshooting-importerror.html
E       
E       Please note and check the following:
E       
E         * The Python version is: Python3.13 from "/usr/bin/python3"
E         * The NumPy version is: "1.22.3"
E       
E       and make sure that they are the versions you expect.
E       Please carefully study the documentation linked above for further help.
E       
E       Original error was: No module named 'numpy.core._multiarray_umath'

/opt/Coreform-Cubit-2024.8/bin/python3/lib/python3.10/site-packages/numpy/core/__init__.py:49: ImportError

This happened the other day when I was trying to use some linear algebra stuff from numpy, same error. Now the oddity in this case may be, that I import cubit twice, once from my class which calls cubit, and once from my test which uses cubit to build geometry e,g. class 1

import sys
import cubit 
class bob:
    def __init__(self):
         cubit.whatever

and the import in my test

import sys
import cubit
from bob import bob
t = bob()

And it will be when the imports are done from the import of bob that this error will happen.

Hi @makeclean,
which numpy version are you using? We currently think that the version from cubit and your package doesn’t match.