Import error with Cubit Python on Mac

CubitVersion: Cubit 2021.5
Platform: Mac OS 11.5.1

Issue

Importing Cubit Python on a Mac raised an error, just wondering if this has been imported correctly or there is a potential bug

We should be using Python 3.8 on all the systems. I don’t have a Mac easily available. Would you start up Cubit, go to the Python tab and enter

import sys
sys.version

to verify the version.

You could also look in the About dialog, but I’d rather get the answer from the source.

Just to clarify this is an attempt to importing Cubit into the system python (top of the screen shot suggests python 3.8)

When running the sys commands suggested I see python 3.9 so I’m not quite sure how that got there

Looks like Cubit 2021.5 on a mac comes with python 3.9 instead of the 3.8 that I see on other os

We build against the Mac OS native python install. This has caused fewer problems on Mac in the past. There is likely a difference in the Mac OS version on our build machine vs the Mac OS version that you are running. I don’t know what version our build machine is running.

We use a tool called swig to wrap the C++ interface for python and the swig tool is not python minor version independent (yet). You must run the same version of python as installed with Cubit to import Cubit.

We typically suggest running the python installed in Cubit to avoid any issues versions.

Understood

It looks like I can change my system python to 3.9 to match the internal Cubit Python and then import

conda create --name py39 python=3.9

Thanks for your speedy response

It is kind of funny timing as I was previously looking for python3.9 cubit Python 3.9 support in Cubit