MF6 Path variable

303 views
Skip to first unread message
Assigned to sss.pad...@gmail.com by me

Chris Russoniello

unread,
Apr 23, 2020, 12:23:27 AM4/23/20
to MODFLOW Users Group
Hi,

I have a fresh install of Spyder and Python 3 (Anaconda), as well as Flopy (pip install), and a fresh download of MF6. I added MF6 to the path variable under system properties -> environmental variables -> system variables -> path as "C:\WRDApp\mf6.1.0\bin". 

When I type "MF6" into the command prompt, MF 6 runs.

When I run the demo code on the FloPy Git, in Spyder, I get the error:

File "C:\ProgramData\Anaconda3\lib\site-packages\flopy\mbase.py", line 1568, in run_model
    raise Exception(s)
Exception: The program mf6 does not exist or is not executable.

I cannot figure why Python/Spyder cannot see MF6 if the OS can through the cmd app.

Any help would be appreciated. Thanks!

-Chris


Jonathan Quiroz

unread,
Apr 23, 2020, 7:27:40 AM4/23/20
to MODFLOW Users Group
You have to give it the path in which your executable is located, you give this value in flopy.mf6.MFSimulation and the variable is called "exe_name"

Chris Russoniello

unread,
Apr 23, 2020, 12:03:21 PM4/23/20
to MODFLOW Users Group
Jonathan,

Thank you for the quick response.

I'm trying to run sample code from the FloPy Git Readme (https://github.com/modflowpy/flopy/blob/develop/README.md). I've also tried some other sample code that should work (MF6 tutorials on the Git)

I set:
"sim = flopy.mf6.MFSimulation(sim_name=name, exe_name='mf6', version='mf6', sim_ws=workspace)", which doesn't work, though I'd have thought it should since my MF6 bin file is set as an environmental variable under 'path'.
I also tried:
sim = flopy.mf6.MFSimulation(sim_name=name, exe_name='C:\WRDApp\mf6.1.0\bin\mf6', version='mf6', sim_ws=workspace)
sim = flopy.mf6.MFSimulation(sim_name=name, exe_name='C:\WRDApp\mf6.1.0\bin\mf6.exe', version='mf6', sim_ws=workspace)

I also tried changing my directory name to remove the 'dots' and changing in the code as well, e.g.
sim = flopy.mf6.MFSimulation(sim_name=name, exe_name='C:\WRDApp\mf6_1_0\bin\mf6.exe', version='mf6', sim_ws=workspace)

in each case I receive an exception like:
Exception: The program C:\WRDApp\mf6.1.in\mf6 does not exist or is not executable.

I also tried running the same code in a JupiterNB instead of through Spyder, but receive the same exception.

I'm running windows 10 enterprise and I am logged in through an administrative account.

I'm at bit of a loss, so any thoughts would be helpful.

-Chris

Jonathan Quiroz

unread,
Apr 23, 2020, 11:47:48 PM4/23/20
to MODFLOW Users Group
Hello, try this path: 'C:\\WRDApp\\mf6.1.0\\bin\\mf6.exe',  if you get an error again just copy and paste the executable to your project folder in order to avoid problemss and then you just have to write this path: 'mf6.exe'

kind regards.

Ryan Burgess

unread,
Sep 4, 2020, 12:50:30 AM9/4/20
to MODFLOW Users Group
Hi Chris,

Did you ever resolve this issue? I'm having the exact same one.

Ryan

Chris

unread,
Sep 5, 2020, 12:35:42 AM9/5/20
to mod...@googlegroups.com
Ryan,

I never did figure it out on my laptop, but it ended up working fine on my processing machine where I do most of my work anyway. I'd love to hear if you figure it out, tho.

-Chris

--
You received this message because you are subscribed to a topic in the Google Groups "MODFLOW Users Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/modflow/N4dk1KmV7jo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to modflow+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modflow/bc91cbdd-f299-4599-855d-12d8e429a06dn%40googlegroups.com.

Ryan Burgess

unread,
Nov 19, 2020, 12:17:23 AM11/19/20
to MODFLOW Users Group
I did fix this shortly after posted this message but can't recall exactly the solution. I think I simply just restarted my laptop.......
Reply all
Reply to author
Forward
0 new messages