Hello,
I’m a beginner user of OpenGeoSys, but I think there is a problem with the binaries distributed by PIP packages:
Folowing the procedure in Your first OGS run in 5 minutes with “Option 1: Python”, I set everything ok with pip install ogstools[ogs], but running the example gives the error:
❯ python .\Linear_Disc_with_hole.py
Simulation: disc_with_hole.prj
Status: terminated with error code 1.
Last 10 line of the log:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\...\OGS\.venv\Scripts\ogs.exe\__main__.py", line 7, in <module>
File "C:\...\OGS\.venv\Lib\site-packages\ogs\_internal\provide_ogs_cli_tools_via_wheel.py", line 84, in ogs
raise SystemExit(ogs_with_args(sys.argv))
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\...\OGS\.venv\Lib\site-packages\ogs\_internal\provide_ogs_cli_tools_via_wheel.py", line 88, in ogs_with_args
import ogs.simulator as sim
ImportError: DLL load failed while importing simulator: Não foi possível encontrar o módulo especificado.
Traceback (most recent call last):
File "C:\...\OGS\Linear_Disc_with_hole.py", line 224, in <module>
model.run_model(logfile=f"{out_dir}/out.txt", args=f"-o {out_dir}")
File "C:\...\OGS\.venv\Lib\site-packages\ogstools\ogs6py\project.py", line 914, in run_model
self._failed_run_print_log_tail(write_logs)
File "C:\...\OGS\.venv\Lib\site-packages\ogstools\ogs6py\project.py", line 764, in _failed_run_print_log_tail
raise RuntimeError(msg)
RuntimeError: OGS execution was not successful.
However, by downloading the binary and putting the /bin folder on the PATH after activating the environment, it runs ok.
So, I think the issue is with the binary distributed with PIP.
I also searched for this problem before creating this topic, and saw post “1667” (sorry, I can’t link because I’m new user and the site does not allow me…)
We’ll try to reproduce the problem. Btw.: What are your PATH, PYTHONPATH, Python version in the virtual environment? Which distribution do you use (anaconda/minicondy/python.org/…)?
I encounter exactly the same problem. Everything went well with,
import ogstools as ot
model = ot.Project(input_file=“xx.prj”, output_file=“xx.prj”)
model.replace_text(‘…’)
model.write_input()
then when I run,
model.run_model(logfile=“out.txt”),
The exactly same error came out.
I am using,
OS: Windows 10
Python distribution: Anaconda
Python version: 3.11.7
OGS version: 6.5.6 (installed via pip install ogs)
Environment: base conda environment
The OGS package is installed in C:\Users\Anwender\anaconda3\Lib\site-packages\ogs.
Hey, I solved the problem, by downloading the older version
pip install ogs==6.5.2,
Because this is the version that my another computer is working.
Hope the ogs development team can solve the issue in OGS version 6.5.6 with the simulator
I tried the 6.5.6 pip package on Python 3.11 as well and for me it worked. Maybe the Conda environment interferes? Please note that we also have native Conda packages of ogs and ogstools: