Modulenotfounderror no module named dolfin

Hi, I’m trying to run the simplest Hyperelasticity code to check the Fenics,
but I’m keep getting this error when I try to run the code:
“Modulenotfounderror no module named dolfin”

I tried installing dolfin and dolfinx with different methods.
I would really like to hear from someone who faced the same issue.

some details to help:
Ubuntu version 22.04
dolfin version 2019.2.0.dev0

Screenshot from 2023-06-16 17-05-15

You haven’t stated what method you used for installation. It looks like you are using conda, in which case, you need to activate the conda environment in which you installed dolfin or dolfinx.

Note that you should either be using dolfin or dolfinx. Assuming you are just starting, I would recommend using dolfinx. This can be installed using the installation instructions. Again, assuming you are using conda, this can be done through

conda create -n fenicsx-env
conda activate fenicsx-env
conda install -c conda-forge fenics-dolfinx mpich pyvista
1 Like

try running it with python3, not python (which might be python2)

that is, check

python --version