Cannot import name 'Form' from 'dolfinx'

Hi, I just installed the newest dolfinx following instructions on github for linux (ubuntu) using conda.

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

However, when I run the demo code from Cahn-Hilliard equation — DOLFINx 0.9.0.0 documentation

I get the error

$ python ./demo_cahn-hilliard.py 
Traceback (most recent call last):
  File "path/./demo_cahn-hilliard.py", line 117, in <module>
    from dolfinx import (Form, Function, FunctionSpace, NewtonSolver,
ImportError: cannot import name 'Form' from 'dolfinx'

Any help would be appreciated. Thanks!

Hi,

I think you are running a different demo_cahn-hilliard.py file instead of the one given from the link you provided.

Hi,

Sorry for the late response. I did mix up the versions and have since resolved the issue. Thanks!