Hi to all ^^, I have a problem when importing dolfinx, the error is the following :
TypeError: function() argument 'code' must be code, not str
the traceback is :
Input In [1], in
----> 1 import dolfinxFile /usr/lib/petsc/lib/python3/dist-packages/dolfinx/init.py:45, in
40 from dolfinx.generation import (IntervalMesh, BoxMesh, RectangleMesh,
41 UnitIntervalMesh, UnitSquareMesh, UnitCubeMesh)
43 from .cpp.mesh import Topology, Geometry
—> 45 from .fem.form import Form
46 from .fem.dirichletbc import DirichletBC
47 from .fem import (FunctionSpace, VectorFunctionSpace,
48 TensorFunctionSpace, Constant, Expression, Function)File /usr/lib/petsc/lib/python3/dist-packages/dolfinx/fem/init.py:10, in
7 “”“Tools for assembling and manipulating finite element forms”“”
9 from dolfinx.cpp.fem import IntegralType
—> 10 from dolfinx.fem.assemble import (apply_lifting, apply_lifting_nest,
11 assemble_matrix, assemble_matrix_block,
12 assemble_matrix_nest, assemble_scalar,
13 assemble_vector, assemble_vector_block,
14 assemble_vector_nest, create_matrix,
15 create_matrix_block, create_matrix_nest,
16 create_vector, create_vector_block,
17 create_vector_nest, set_bc, set_bc_nest)
18 from dolfinx.fem.dirichletbc import (DirichletBC, locate_dofs_geometrical,
19 locate_dofs_topological)
20 from dolfinx.fem.dofmap import DofMapFile /usr/lib/petsc/lib/python3/dist-packages/dolfinx/fem/assemble.py:16, in
14 import ufl
15 from dolfinx import cpp
—> 16 from dolfinx.fem.dirichletbc import DirichletBC
17 from dolfinx.fem.form import Form
20 def _create_cpp_form(form):File /usr/lib/petsc/lib/python3/dist-packages/dolfinx/fem/dirichletbc.py:19, in
17 import ufl
18 from dolfinx import cpp
—> 19 from dolfinx.fem.function import Function, FunctionSpace
22 def locate_dofs_geometrical(V: typing.Iterable[typing.Union[cpp.fem.FunctionSpace, FunctionSpace]],
23 marker: types.FunctionType):
24 “”“Locate degrees-of-freedom geometrically using a marker function.
25
26 Parameters
(…)
49
50 “””File /usr/lib/petsc/lib/python3/dist-packages/dolfinx/fem/function.py:20, in
16 from dolfinx import common, cpp, jit
17 from dolfinx.fem import dofmap
—> 20 class Constant(ufl.Constant):
21 def init(self, domain, c: typing.Union[np.ndarray, typing.Sequence, float]):
22 “”“A constant with respect to a domain.
23
24 Parameters
(…)
28 Value of the constant.
29 “””TypeError: function() argument ‘code’ must be code, not str
Thanks by advance !!!