Using Numpy in Journal-File

Hello,

I want to use numpy directly in the journal file, but I ran into some troubles. I get an error, which states

RuntimeError: The current Numpy installation ('/share/programs/coreform/Coreform-Cubit-2021.4/bin/python3/lib/python3.8/site-packages/numpy/__init__.py') fails to pass simple sanity checks. This can be caused for example by incorrect BLAS library being linked in, or by mixing package managers (pip, conda, apt, ...). Search closed numpy issues for similar problems.

I already tried some suggestions, which I found on the internet. However, I still get the error.

Does anyone have an idea?

Best regards
Andreas

Try updating to Coreform Cubit 2022.4. It ships with an installation of numpy as part of the python3 distribution packaged with Cubit.

Hi,

thanks for the advice.
Unfortunately, this doesn’t work either. I get the following error:

ImportError: No module named numpy

This error occurs when I execute the journal file and when directly typing it in the python terminal of the GUI.

Below, I uploaded the files. Do i need to define anything in particular?

sa3d_latest.jou (5.1 KB)
coords.txt (83 Bytes)

Best regards

Please try this for me and send me the full output:

export CUBIT_VERBOSE=5
/share/programs/coreform/Coreform-Cubit-2022.4/bin/coreform_cubit -nog

This will bring up a Cubit Python prompt in your terminal. In that prompt, type

import numpy

When I try that on my Ubuntu 20 machine with Coreform Cubit 2022.4, I can import numpy successfully. What output do you get?

below the output file.

cubit_export.txt (8.9 KB)

In this terminal, import numpy throws any error.

So you were able to import numpy successfully then? What about if you start the GUI, and in a plain python prompt run import numpy?

Hi Andreas,

Two small suggestions that are just odd in your process.

  1. The top of your file contains two shebangs (!#). The second should be irrelevant but it is odd. I would remove it.
#!python
#!/usr/bin/python

You name your input file with a “.jou” extension. It contains python commands and not traditional Cubit command language. I would change the extension to “.py”.

I don’t think either of these really matter, they are just different than my normal usage.

I started Cubit 2022.4 on my Windows machine and then opened the journal editor. Before importing your file, I changed the mode to python by clicking on the highlighted icon in the image below.
image

I was then able to hit run in the journal editor and generate your model.

image

Are you able to replicate this process?

Thanks,
Karl

Hi Karl,

many thanks for your suggestion and advice.
Yes, now it works.

Best regards
Andreas