Conceptual Models > Incorporation PHREEQC in programming languages

Batch PHREEQC via Python script

(1/1)

freiburgermsu:
Hello!

I am developing a command-line UI for ROSSpy (https://pypi.org/project/ROSSpy/) via the PHREEQC.bat file. I continually receive the attached error message that "The system cannot find the path specified". This cannot be true, since the paths are verified to exist in the system in the Python lines (https://github.com/freiburgermsu/ROSSpy/blob/main/irosspy/iROSSpy.py#L590-L595) just preceeding the execution of the batch file (https://github.com/freiburgermsu/ROSSpy/blob/main/irosspy/iROSSpy.py#L597-L601).

What is the source of this error, and how can it be resolved?

dlparkhurst:
I don't know. Perhaps the line is too long?

The phreeqc.bat file usually says "input file not found" or "database file not found", so I am not sure where the message "the system cannot find" comes from. It is not in the code for phreeqc.

Try putting all the files in one directory (.bat, input, database), cd to that directory, and run the bat file (phreeqc.bat input output database).

freiburgermsu:
Hello David,

We elected to circumvent this bug from calling the batch PHREEQC software by simply using PHREEQpy. This disadvantageously does neither generates a full PQO report nor displays updates as the PQI file is executed, but it is sufficient for the simple results. I may revisit this concept is future versions of ROSSpy.

Thank you :)
   Andrew

smidera:
Hope it's not too late to comment on that. I've been using phreeqpy to automate some calculations and I use the function set_output_file_on to get the results just like the PQO report. By default it saves the file at the running directory with an extension .out (ex. phreeqc.0.out). You can change the file name using standard python module os.rename().


--- Code: ---import phreeqpy.iphreeqc.phreeqc_dll as phreeqc_mod
phreeqc = phreeqc_mod.IPhreeqc()
phreeqc.load_database(r"phreeqc.dat")
phreeqc.set_output_file_on()

--- End code ---

Navigation

[0] Message Index

Go to full version