You haven’t provided a reproducible example of your last attempt. I can only guess that you import os
and dolfinx
, and afterwards set the environment variable. That is wrong: you must import os
, set the environment variable, and then import dolfinx
.