# Problem with installation

**URL:** <https://fenicsproject.discourse.group/t/problem-with-installation/11808>\
**Category:** dolfinx\
**Tags:** installation\
**Created:** [July 24, 2023, 2:44pm UTC](https://fenicsproject.discourse.group/t/problem-with-installation/11808 "2023-07-24T14:44:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eloi](https://avatars.discourse-cdn.com/v4/letter/e/3ec8ea/32.png) [@Eloi](https://fenicsproject.discourse.group/u/Eloi)\
**Post date:** [July 24, 2023, 2:44pm UTC](https://fenicsproject.discourse.group/t/problem-with-installation/11808/1 "2023-07-24T14:44:56Z")

</div>

Hello,  
I’m currently struggling to install FenicsX. I ran

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

```

but when running

```auto
import dolfinx

```

in python I get the error

```auto
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/eloi/anaconda3/envs/fenicsx-env/lib/python3.10/site-packages/dolfinx/ __init__.py", line 31, in <module>
    from dolfinx import fem, geometry, graph, io, jit, la, log, mesh, nls, plot
  File "/home/eloi/anaconda3/envs/fenicsx-env/lib/python3.10/site-packages/dolfinx/io/ __init__.py", line 10, in <module>
    from dolfinx.io import gmshio # noqa: F401
  File "/home/eloi/anaconda3/envs/fenicsx-env/lib/python3.10/site-packages/dolfinx/io/gmshio.py", line 68, in <module>
    def extract_topology_and_markers(model: gmsh.model, name: typing.Optional[str] = None):
AttributeError: module 'gmsh' has no attribute 'model'

```

I have no idea why it happens, I would really like your help.  
Have a good day,  
Eloi.

---

<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:** [July 24, 2023, 3:00pm UTC](https://fenicsproject.discourse.group/t/problem-with-installation/11808/2 "2023-07-24T15:00:43Z")

</div>

You should install gmsh with `conda` as well, at the time of installation of DOLFINx.

---

<div class="post-metadata">

**Author:** ![Eloi](https://avatars.discourse-cdn.com/v4/letter/e/3ec8ea/32.png) [@Eloi](https://fenicsproject.discourse.group/u/Eloi)\
**Post date:** [July 26, 2023, 8:15am UTC](https://fenicsproject.discourse.group/t/problem-with-installation/11808/3 "2023-07-26T08:15:14Z")

</div>

Thank you, I thought it would be downloaded automatically. I tried some things and it didn’t work so a deleted and re-installed Miniconda. Now when trying to

```auto
conda install -c conda-forge fenics-dolfinx

```

I get

```auto
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed                                                                                                                                  

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - fenics-dolfinx -> python[version='2.7.*|3.5.*|3.6.*|3.6.12|3.6.12|3.7.10|3.7.10|3.7.12|3.8.12|3.8.16|3.9.16|>=3.11,<3.12.0a0|3.9.10|>=3.6,<3.7.0a0|3.7.9|3.6.9|3.6.9|3.6.9|>=2.7,<2.8.0a0|3.6.9|>=3.5,<3.6.0a0|3.4.*|>=3.7|3.10.*|3.9.*|3.8.*|3.7.*',build='0_73_pypy|1_73_pypy|3_73_pypy|4_73_pypy|5_73_pypy|5_73_pypy|1_73_pypy|0_73_pypy|0_73_pypy|2_73_pypy']
  - fenics-dolfinx -> python[version='>=3.10,<3.11.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0']

Your python: python=3.11

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

The following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.31=0
  - python=3.11 -> libgcc-ng[version='>=11.2.0'] -> __glibc[version='>=2.17']

Your installed version is: 2.31

```

Is dolfinx not compatible with Python 3.11 ? Or libgcc causes the problem ?

---

<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:** [July 26, 2023, 8:30am UTC](https://fenicsproject.discourse.group/t/problem-with-installation/11808/4 "2023-07-26T08:30:39Z")

</div>

The release of Dolfinx that is on conda (0.6.0) is not compatible with 3.11. This has been fixed in the main branch if dolfinx

---

<div class="post-metadata">

**Author:** ![Eloi](https://avatars.discourse-cdn.com/v4/letter/e/3ec8ea/32.png) [@Eloi](https://fenicsproject.discourse.group/u/Eloi)\
**Post date:** [July 26, 2023, 9:25am UTC](https://fenicsproject.discourse.group/t/problem-with-installation/11808/5 "2023-07-26T09:25:26Z")

</div>

Ok now dolfinx is installed but I get back the gmsh problem. I did

```auto
conda install -c conda-forge gmsh

```

and when I do

```auto
conda list | grep gmsh

```

I do get

```auto
gmsh 4.2.2 h0f49446_0 conda-forge

```

However, I still got the error

```auto
AttributeError: module 'gmsh' has no attribute 'model'

```

When uninstalling it and re-installing it with pip

```auto
pip install --upgrade gmsh

```

it finally works. Apparently, the version of gmsh on conda (4.2) isn’t the right one (4.11).

Bye.

---

<div class="post-metadata">

**Author:** ![igupta](https://avatars.discourse-cdn.com/v4/letter/i/779978/32.png) [@igupta](https://fenicsproject.discourse.group/u/igupta)\
**Post date:** [December 14, 2023, 11:38am UTC](https://fenicsproject.discourse.group/t/problem-with-installation/11808/6 "2023-12-14T11:38:16Z")

</div>

Hi Eloi. I have a similar issue. I can not import gmsh. I have installed gmsh 4.11 but the proble still exists. Does gmsh need to be installed before installing dolfinx?

---

<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:** [December 14, 2023, 12:00pm UTC](https://fenicsproject.discourse.group/t/problem-with-installation/11808/7 "2023-12-14T12:00:54Z")

</div>

If you want to use `dolflnx.io.gmshio` Gmsh has to be installed prior to DOLFINx

---

<div class="post-metadata">

**Author:** ![igupta](https://avatars.discourse-cdn.com/v4/letter/i/779978/32.png) [@igupta](https://fenicsproject.discourse.group/u/igupta)\
**Post date:** [December 14, 2023, 4:00pm UTC](https://fenicsproject.discourse.group/t/problem-with-installation/11808/8 "2023-12-14T16:00:09Z")

</div>

Thank you very much. I reinstalled it now and it solved the issue 🙂
