# Invalid mesh version

**URL:** <https://pyfr.discourse.group/t/invalid-mesh-version/254>\
**Category:** General\
**Created:** [29 September 2019 13:24 UTC](https://pyfr.discourse.group/t/invalid-mesh-version/254 "2019-09-29T13:24:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahmood\_Naderan](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@Mahmood\_Naderan](https://pyfr.discourse.group/u/Mahmood_Naderan)\
**Post date:** [29 September 2019 13:24 UTC](https://pyfr.discourse.group/t/invalid-mesh-version/254/1 "2019-09-29T13:24:56Z")

</div>

Hi,  
I have saved a msh file with gmsh-4.4.1, however, the import command fails with invalid mesh version.

`$ pyfr import ~/Downloads/gmsh-4.4.1-Linux64/share/doc/gmsh/demos/untitled.msh untitiled.pyfrm`

```auto
Traceback (most recent call last):
File "/home/mahmood/.local/bin/pyfr", line 11, in <module>
load_entry_point('pyfr==1.8.5', 'console_scripts', 'pyfr')()
File "/home/mahmood/.local/lib/python3.6/site-packages/pyfr-1.8.5-py3.6.egg/pyfr/ __main__.py", line 110, in main
File "/home/mahmood/.local/lib/python3.6/site-packages/pyfr-1.8.5-py3.6.egg/pyfr/ __main__.py", line 121, in process_import
File "/home/mahmood/.local/lib/python3.6/site-packages/pyfr-1.8.5-py3.6.egg/pyfr/readers/ __init__.py", line 19, in get_reader_by_extn
File "/home/mahmood/.local/lib/python3.6/site-packages/pyfr-1.8.5-py3.6.egg/pyfr/readers/gmsh.py", line 89, in __init__
File "/home/mahmood/.local/lib/python3.6/site-packages/pyfr-1.8.5-py3.6.egg/pyfr/readers/gmsh.py", line 110, in _read_mesh_format
ValueError: Invalid mesh version

```

Any idea to fix that?

---

<div class="post-metadata">

**Author:** ![Junting\_Chen](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@Junting\_Chen](https://pyfr.discourse.group/u/Junting_Chen)\
**Post date:** [29 September 2019 16:05 UTC](https://pyfr.discourse.group/t/invalid-mesh-version/254/2 "2019-09-29T16:05:18Z")

</div>

I always saved mesh file in GMSH version 2 ascii format (it always asks you when you click the save button, maybe there is a way to do that in command lines). As description in the latest PyFR (1.8.5) says, GMSH version 4 should be supported. I’m being lazy didn’t update pyfr yet.

Junting Chen

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [29 September 2019 16:13 UTC](https://pyfr.discourse.group/t/invalid-mesh-version/254/3 "2019-09-29T16:13:41Z")

</div>

Hi,

> I have saved a msh file with gmsh-4.4.1, however, the import command  
> fails with invalid mesh version.

Would you be able to provide us with the first few kilobytes of the mesh  
you are trying to import (we do not need/want the entire mesh, just the  
first few bytes with include the mesh version string).

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![Mahmood\_Naderan](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@Mahmood\_Naderan](https://pyfr.discourse.group/u/Mahmood_Naderan)\
**Post date:** [29 September 2019 16:32 UTC](https://pyfr.discourse.group/t/invalid-mesh-version/254/4 "2019-09-29T16:32:35Z")

</div>

Using GUI and export section, I saved with “Version 2 ASCII”, However, it fails with another error

pyfr import untitled.msh untitled.pyfrm Traceback (most recent call last): File "/home/mahmood/.local/bin/pyfr", line 11, in \<module\> load\_entry\_point('pyfr==1.8.5', 'console\_scripts', 'pyfr')() File "/home/mahmood/.local/lib/python3.6/site-packages/pyfr-1.8.5-py3.6.egg/pyfr/\_\_main\_\_.py", line 110, in main File "/home/mahmood/.local/lib/python3.6/site-packages/pyfr-1.8.5-py3.6.egg/pyfr/\_\_main\_\_.py", line 121, in process\_import File "/home/mahmood/.local/lib/python3.6/site-packages/pyfr-1.8.5-py3.6.egg/pyfr/readers/\_\_init\_\_.py", line 19, in get\_reader\_by\_extn File "/home/mahmood/.local/lib/python3.6/site-packages/pyfr-1.8.5-py3.6.egg/pyfr/readers/gmsh.py", line 89, in \_\_init\_\_ File "/home/mahmood/.local/lib/python3.6/site-packages/pyfr-1.8.5-py3.6.egg/pyfr/readers/gmsh.py", line 215, in \_read\_eles File "/home/mahmood/.local/lib/python3.6/site-packages/pyfr-1.8.5-py3.6.egg/pyfr/readers/gmsh.py", line 227, in \_read\_eles\_impl\_v2 ValueError: Unsupported element type 15 head -n 15 untitled.msh  
$MeshFormat  
2.2 0 8  
$EndMeshFormat  
$ParametricNodes  
67968  
1 -1 -0 0 0 1  
2 -1 0.2 0 0 2  
3 -1.2 0 0 0 3  
4 -1 -0.2 0 0 4  
5 -0.8 0 0 0 5  
6 -1 0.3 0 0 6  
7 -1.3 0 0 0 7  
8 -1 -0.3 0 0 8  
9 -0.7 0 0 0 9  
10 -1 0.4 0 0 10

![image.png](https://global.discourse-cdn.com/free1/uploads/pyfr/original/1X/a7f58a6e27d99afe5ddf47f0922e231c744d74ae.png)
