Executing examples from “Solving PDEs in Python The FEniCS Tutorial I”

In the code ft01_poisson.py the code line

from fenics import *

appears as the first line, but the installation I just made has no module fenics, so an error occurs. Is this book no longer the recommended way to learn FEniCSx, or is there some way I can install the module fenics?
If not, what is the best way to proceed in learning?

See The FEniCSx tutorial — FEniCSx tutorial if you are willing to run those tutorials with FEniCSx

Does this mean that the book is effectively outdated?

Yes, for learning DOLFINx, it is not a recommended way to start, as the API differs quite alot.

As I understand it, in order to use dolfinx to solve a PDE, one must first convert the PDE into a variational problem. Is this always the case in fenicsx? For more complicated problems, will I have to become fluent in converting them to variational problems to solve them? For example, Comsol gives one the choice of formulating the problem as a variational problem or just using the PDEs and boundary conditions. Comsol has written software to convert PDEs into variational problems. Is there any movement in this direction in fenicsx? I realize this is a non-trivial task.

Being able to correctly write the weak formulation of the problem at hand is a basic prerequisite of any finite element method. ufl does offer several helpful tool (e.g., automatically compute derivatives useful e.g. to assemble jacobian of nonlinear problems), but it’s unlikely that it will have a tool that writes down the weak form for you.

Comsol implements a specific subset of methods for a specific subset of equations. UFL based software as DOLFIN, DOLFINx is more generic, and lets the user decide how to specify the variational problem, yielding more ways to experiment/develop new methods.

I understand and appreciate your point. General codes allow specialists freedom to solve special cases, but beginners may find the mental overhead daunting. I appreciate the hard work you guys are doing.