Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run on Windows 10 #20

Open
GuanglinDu opened this issue Oct 10, 2021 · 2 comments
Open

Cannot run on Windows 10 #20

GuanglinDu opened this issue Oct 10, 2021 · 2 comments

Comments

@GuanglinDu
Copy link

GuanglinDu commented Oct 10, 2021

Joerg, thanks for your package. I cannot run it on Windows 10 since the source code is Linux/Mac OS-specific. The error message follows

FileNotFoundError                         Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_5624/1425457894.py in <module>
      1 model.write_input()
----> 2 model.run_model(logfile="out.log")

d:\venv\lib\site-packages\ogs6py\ogs.py in run_model(self, **args)
    475         cmd += f"{self.prjfile} > {self.logfile}"
    476         startt = time.time()
--> 477         returncode = subprocess.run([cmd], shell=True, executable="/bin/bash")
    478         stopt = time.time()
    479         self.exec_time = stopt - startt
@GuanglinDu
Copy link
Author

GuanglinDu commented Oct 11, 2021

A workaround is to use subprocess.call directly without calling model.run_model, which follows
subprocess.call("D:\\ogs\\bin\\ogs.exe simple_mechanics.prj", shell=True)

@joergbuchwald
Copy link
Owner

joergbuchwald commented Oct 11, 2021

Hi!
yes, I'm not really testing things on windows yet, as I have no windows machine.
Is it only this part: >> executable="/bin/bash" <<, that is breaking the code? So, would the following command run on windows?

subprocess.run(["D:\\ogs\\bin\\ogs.exe simple_mechanics.prj > out.log", shell=True]

I changed that in 41d5424 as it is definitely not windows code either way. Could you try again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants