Python and Trelis/Cubit

I’m trying to run a python script to make a cubit grid. Some online
examples say I need to “import cubit”, but when I try this I get an
error message saying “no module named cubit”. I poked around a little
bit, but didn’t find a cubit module for python on my machine.

In order for python to find Trelis or Cubit, you’ll need to add the path to the
cubit.py file to your PYTHONPATH. For example, if the cubit.py file is
in /projects/cubit/bin, then you’d do:

export PYTHONPATH=/projects/cubit/bin:$PYTHONPATH

after that you should be able to start python and successfully import cubit.