# AttributeError: module 'dolfinx.mesh' has no attribute 'CellType'

**URL:** <https://fenicsproject.discourse.group/t/attributeerror-module-dolfinx-mesh-has-no-attribute-celltype/7789>\
**Category:** mesh\
**Created:** [March 6, 2022, 11:25am UTC](https://fenicsproject.discourse.group/t/attributeerror-module-dolfinx-mesh-has-no-attribute-celltype/7789 "2022-03-06T11:25:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hamdi\_Kahloun](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/hamdi_kahloun/32/3173_2.png) [@Hamdi\_Kahloun](https://fenicsproject.discourse.group/u/Hamdi_Kahloun)\
**Post date:** [March 6, 2022, 11:25am UTC](https://fenicsproject.discourse.group/t/attributeerror-module-dolfinx-mesh-has-no-attribute-celltype/7789/1 "2022-03-06T11:25:17Z")

</div>

While i was trying to run the `demo_poisson.py` on the DOLFINx 0.3.1.0 documentation, i encountered the following error:

File “/mnt/d/Users/Desktop/demo\_poisson.py”, line 25, in   
cell\_type=mesh.CellType.triangle)  
AttributeError: module ‘dolfinx.mesh’ has no attribute ‘CellType’

Code, where the error to be found:

```auto
import numpy as np

import ufl

from dolfinx import fem, io, mesh, plot

from ufl import ds, dx, grad, inner

from mpi4py import MPI

from petsc4py.PETSc import ScalarType

#Create Mesh and FunctionSpace V :

msh = mesh.create_mesh(comm=MPI.COMM_WORLD,

                            points=((0.0, 0.0), (1.0, 1.0)), n=(32, 32),

                            cell_type=mesh.CellType.triangle)

V = fem.FunctionSpace(msh, ("Lagrange", 1))

```

my question is: after looking in the reference documentation (2022) of Dolfinx, i find the same declaration methode for the mesh class function (Attribute) CellType. Is there another way (update or so.) to to define CellType in Python?

PS: I’m using pip and not docker. (Debian/Ubuntu packages)`Preformatted text`

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [March 6, 2022, 4:07pm UTC](https://fenicsproject.discourse.group/t/attributeerror-module-dolfinx-mesh-has-no-attribute-celltype/7789/2 "2022-03-06T16:07:07Z")

</div>

> [@Hamdi\_Kahloun](#):
>
> PS: I’m using pip and not docker. (Debian/Ubuntu packages) `Preformatted text`

As far as Im aware the debian packages using the 0.3.0 release ([https://packages.debian.org/sid/python3-dolfinx](https://packages.debian.org/sid/python3-dolfinx)) where you have to import celltype as `from dolfinx.cpp.mesh import CellType`.  
See for instance the demos from the 0.3.0 release: [https://github.com/FEniCS/dolfinx/tree/v0.3.0/python/demo](https://github.com/FEniCS/dolfinx/tree/v0.3.0/python/demo)
