gmsh EnvironmentError: Gmsh version must be >= 2.0.

122 views
Skip to first unread message

Daniel DeSantis

unread,
Feb 5, 2016, 8:59:09 AM2/5/16
to fi...@list.nist.gov
Hello,

I am trying to run FiPy on a Windows XP system. I have gmsh installed on my
system. Does gmsh need to be in a certain file location?

If I try to run commands with the Gmsh interface commands, such as
Gmsh2D(), I receive the following error.

File "<ipython-input-1-44aa13cad657>", line 1, in <module>

runfile('C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py',
wdir='C:/Users/ddesantis/Dropbox/PythonScripts/FiPy')

File
"C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py",
line 699, in runfile
execfile(filename, namespace)

File
"C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py",
line 74, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)

File "C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py",
line 26, in <module>
''' % locals())

File
"C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\meshes\gmshMesh.py",
line 1578, in __init__
background=background)

File
"C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\meshes\gmshMesh.py",
line 151, in openMSHFile
raise EnvironmentError("Gmsh version must be >= 2.0.")

EnvironmentError: Gmsh version must be >= 2.0.

Any advice?

Thank you,

Dan

Guyer, Jonathan E. Dr.

unread,
Feb 5, 2016, 11:30:41 AM2/5/16
to fi...@list.nist.gov
I would guess that you've run into the problem in https://github.com/usnistgov/fipy/issues/462

We fixed this last summer, but haven't pushed a new release since then (sorry about that).

If you check out the `develop` branch from our repository, I think that will correct this problem.

If not, tell us what you get if you type `gmsh --version` at the command line.

> _______________________________________________
> fipy mailing list
> fi...@list.nist.gov
> http://www.ctcms.nist.gov/fipy
> [ NIST internal ONLY: https://groups.google.com/a/list.nist.gov/forum/#!forum/fipy ]


Alexandre Danescu

unread,
Feb 5, 2016, 12:03:44 PM2/5/16
to fi...@list.nist.gov
Hello,

I'm just trying to help you... no particular location.

You simply download the .zip file and unzip it in "gmsh" folder in
"C:\Program Files" folder.

I'm running Fipy on Windows XP, 32-bit CPU, using Spyder and
WinPython-32bit-2.7.5.3.

But installation of Fipy was not straigtforward...

Best regards,

Alex

Le 05/02/2016 14:59, Daniel DeSantis a ?crit :

Daniel DeSantis

unread,
Feb 5, 2016, 12:26:11 PM2/5/16
to fi...@list.nist.gov
Dr. Guyer,

Thanks for the advice. It seemed to solve the error. Unfortunately, another
one cropped up immediately. Sorry to be a bother but I have to ask, have
you seen any errors come up regarding a NameError on factory meshes?


File "<ipython-input-4-44aa13cad657>", line 1, in <module>

runfile('C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py',
wdir='C:/Users/ddesantis/Dropbox/PythonScripts/FiPy')

File
"C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py",
line 699, in runfile
execfile(filename, namespace)

File
"C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py",
line 74, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)

File "C:/Users/ddesantis/Dropbox/PythonScripts/FiPy/Diffusion_Circle.py",
line 7, in <module>
from fipy import *

File
"C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\__init__.py",
line 45, in <module>
from fipy.boundaryConditions import *

File
"C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\boundaryConditions\__init__.py",
line 2, in <module>
from fipy.boundaryConditions.fixedFlux import *

File
"C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\boundaryConditions\fixedFlux.py",
line 40, in <module>
from fipy.boundaryConditions.boundaryCondition import BoundaryCondition

File
"C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\boundaryConditions\boundaryCondition.py",
line 38, in <module>
from fipy.variables.variable import Variable

File
"C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\__init__.py",
line 11, in <module>
from fipy.variables.histogramVariable import *

File
"C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\variables\histogramVariable.py",
line 38, in <module>
from fipy.meshes import Grid1D

File
"C:\Users\ddesantis\AppData\Local\Continuum\Anaconda2\lib\site-packages\fipy\meshes\__init__.py",
line 9, in <module>
__all__.extend(factoryMeshes.__all__)

NameError: name 'factoryMeshes' is not defined

--
Daniel DeSantis

uyer,

Daniel DeSantis

unread,
Feb 5, 2016, 3:46:46 PM2/5/16
to fi...@list.nist.gov
Guess I spoke too soon. Somehow the same error came up again even though I
still have the suggested edit to the gmshMesh.py file... I have the gmsh
folder located in the site-packages folder, for whatever that is worth. If
I run gmsh --version anywhere but from inside the gmsh folder, I get an
error saying gmsh is not a command. If I run gmsh --version inside the gmsh
folder, I get 2.11.0.

Any ideas?

Thanks


--
Daniel DeSantis

I spoke too soon. Somehow the same error came up again even though I

Guyer, Jonathan E. Dr.

unread,
Feb 8, 2016, 3:49:46 PM2/8/16
to fi...@list.nist.gov
The gmsh command needs to be on your PATH environment variable and the fact that it only runs when your working directory is set the gmsh folder means that it's not on your PATH. I'm not a Windows user, so I don't know the best way to do this.

Guyer, Jonathan E. Dr.

unread,
Feb 8, 2016, 3:51:01 PM2/8/16
to fi...@list.nist.gov
Strange. I sort of understand what this error message means, but I don't understand why it's never been a problem before.

Daniel DeSantis

unread,
Feb 8, 2016, 4:20:52 PM2/8/16
to fi...@list.nist.gov
So, some of that information and a little research on my own helped. For
some reason the PATH wasn't reading into the gmsh folder. By adding the
folder with the gmsh executable into the path, I was able to get it to
read. Just FYI, for anyone who might need it, I used this little guide

http://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-7

When I type gmsh --version into the command window, I get 2.11.0

Of course, now I'm getting a ValueError saying that 2.11.0 is an invalid
version number.

Maybe I should download and try an older gmsh version? I will probably play
with this some more unless you have any ideas?

I'll post updates just in case anyone else ever runs into these problems.

On Mon, Feb 8, 2016 at 3:51 PM, Guyer, Jonathan E. Dr. <

ome of that information and a little research on my own helped. For

Guyer, Jonathan E. Dr.

unread,
Feb 8, 2016, 4:53:34 PM2/8/16
to fi...@list.nist.gov
You can either download an older gmsh version or you can fetch a recent copy of our develop branch from github repo, if you're comfortable with that.

Jason Furtney

unread,
Feb 9, 2016, 9:21:35 AM2/9/16
to fi...@list.nist.gov
I use the following "monkey patch" to get around this problem. Just
include these lines at the top of your FiPy script.

import fipy
fipy.meshes.gmshMesh._gmshVersion = lambda **kwargs : 2.0

On Mon, Feb 8, 2016 at 3:53 PM, Guyer, Jonathan E. Dr.

Reply all
Reply to author
Forward
0 new messages