Problem loading database, please help!

265 views
Skip to first unread message

charleywan2004

unread,
Nov 25, 2015, 9:36:26 AM11/25/15
to phreeqpy-users
I am new in using phreeqpy. 

I just installed phreeqpy by using "pip install -U phreeqpy". I also installed "Phreeqc Interactive 3.3.3-10424".

I used the example from "http://water.usgs.gov/nrp/proj.bib/Publications/2011/muller_parkhurst_etal_2011.pdf", and encountered the following error

>>> ================================ RESTART ================================
>>> 
phreeqc.phc_database_error_count= 295

Traceback (most recent call last):
  File "C:\Users\218007366\Desktop\PhreeqcWebDEV\testPhreeqc.py", line 37, in <module>
    phreeqc.run_string(initial_conditions)
  File "C:\Users\218007366\AppData\Local\Continuum\Anaconda2\lib\site-packages\phreeqpy\iphreeqc\phreeqc_dll.py", line 287, in run_string
    self.raise_string_error(errors)
  File "C:\Users\218007366\AppData\Local\Continuum\Anaconda2\lib\site-packages\phreeqpy\iphreeqc\phreeqc_dll.py", line 117, in raise_string_error
    raise Exception(msg + self.get_error_string())
Exception: An error occured.
ERROR: RunString: No database is loaded

>>> 

I saw the post "problem reading database", I put the absolute path in "phreeqc.load_database". It still showed the same error message, and phreeqc.phc_database_error_count=295. Please help! 

###########################################################
import phreeqpy.iphreeqc.phreeqc_dll as phreeqc_mod

def make_initial_conditions ():
#"""
#Specify initial conditions data blocks.
#Uniform initial conditions are assumed.
#"""
 initial_conditions = """
 TITLE Example 11.--Transport and ion exchange.
 SOLUTION 0 CaCl2
 units mmol/kgw
 temp 25.0
 pH 7.0 charge
 pe 12.5 O2(g) -0.68
 Ca 0.6
 Cl 1.2
 SOLUTION 1 Initial solution for column
 units mmol/kgw
 temp 25.0
 pH 7.0 charge
 pe 12.5 O2(g) -0.68
 Na 1.0
 K 0.2
 N(5) 1.2
 END
 EXCHANGE 1
 equilibrate 1
 X 0.0011
 END
 """
 return initial_conditions

phreeqc = phreeqc_mod.IPhreeqc()
phreeqc.load_database(r"C:\\Program Files (x86)\\USGS\Phreeqc Interactive 3.3.3-10424\\database\\phreeqc.dat")
print "phreeqc.phc_database_error_count=",phreeqc.phc_database_error_count
initial_conditions = make_initial_conditions()
phreeqc.run_string(initial_conditions)


Parkhurst, David

unread,
Nov 25, 2015, 10:08:25 AM11/25/15
to phreeqp...@googlegroups.com
I am not fluent in Python, but do you need two back slashes after USGS?

--
You received this message because you are subscribed to the Google Groups ""phreeqpy-users" group.
To post to this group, send email to phreeqp...@googlegroups.com.
To unsubscribe from this group, send email to phreeqpy-user...@googlegroups.com.
For more options, visit this group at https://groups.google.com/d/forum/phreeqpy-users?hl=en.
 
More information about PhreeqPy can be found at http://www.phreeqpy.com.
---
You received this message because you are subscribed to the Google Groups "phreeqpy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phreeqpy-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Müller

unread,
Nov 25, 2015, 11:30:38 AM11/25/15
to phreeqp...@googlegroups.com

change:

r"C:\\Program Files (x86)\\USGS\Phreeqc Interactive
3.3.3-10424\\database\\phreeqc.dat"

either in:

r"C:\Program Files (x86)\USGS\Phreeqc Interactive 3.3.3-10424\database\phreeqc.dat"

or in:

"C:\\Program Files (x86)\\USGS\Phreeqc Interactive
3.3.3-10424\\database\\phreeqc.dat")

The prefix `r` creates a raw string and you can paste the full path from explorer.
Without the `r`, use a double backslash. But don't do both at the am time.

Mike


Am 25.11.15 um 15:36 schrieb charleywan2004:
> I am new in using phreeqpy.
>
> I just installed phreeqpy by using "pip install -U phreeqpy". I also
> installed "Phreeqc Interactive 3.3.3-10424".
>
> I used the example from
> "http://water.usgs.gov/nrp/proj.bib/Publications/2011/muller_parkhurst_etal_2011.pdf
> <http://water.usgs.gov/nrp/proj.bib/Publications/2011/muller_parkhurst_etal_2011.pdf>",
> and encountered the following error
>
> >>> ================================ RESTART ================================
> >>>
> *phreeqc.phc_database_error_count= 295*
>
> Traceback (most recent call last):
> File "C:\Users\218007366\Desktop\PhreeqcWebDEV\testPhreeqc.py", line 37, in
> <module>
> phreeqc.run_string(initial_conditions)
> File
> "C:\Users\218007366\AppData\Local\Continuum\Anaconda2\lib\site-packages\phreeqpy\iphreeqc\phreeqc_dll.py",
> line 287, in run_string
> self.raise_string_error(errors)
> File
> "C:\Users\218007366\AppData\Local\Continuum\Anaconda2\lib\site-packages\phreeqpy\iphreeqc\phreeqc_dll.py",
> line 117, in raise_string_error
> raise Exception(msg + self.get_error_string())
> Exception: An error occured.
> *ERROR: RunString: No database is loaded*
>
> >>>
>
> *I saw the post "problem reading database", I put the absolute path in
> "phreeqc.load_database". It still showed the same error message,
> and phreeqc.phc_database_error_count=295. Please help!*
> *print "phreeqc.phc_database_error_count=",phreeqc.phc_database_error_count*
> initial_conditions = make_initial_conditions()
> phreeqc.run_string(initial_conditions)
>
>
> --
> You received this message because you are subscribed to the Google Groups
> ""phreeqpy-users" group.
> To post to this group, send email to phreeqp...@googlegroups.com.
> To unsubscribe from this group, send email to
> phreeqpy-user...@googlegroups.com.
> For more options, visit this group at
> https://groups.google.com/d/forum/phreeqpy-users?hl=en.
>
> More information about PhreeqPy can be found at http://www.phreeqpy.com.
> ---
> You received this message because you are subscribed to the Google Groups
> "phreeqpy-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phreeqpy-user...@googlegroups.com
> <mailto:phreeqpy-user...@googlegroups.com>.

charleywan2004

unread,
Nov 25, 2015, 12:37:18 PM11/25/15
to phreeqpy-users
I tried the following 4 scenarios. (I also put "phreeqc.dat" in the current work directory for the last 2 scenarios). But I still got the same error message. Please help.  
 
phreeqc = phreeqc_mod.IPhreeqc()
#(1)
#phreeqc.load_database(r"C:\Program Files (x86)\USGS\Phreeqc Interactive 3.3.3-10424\database\phreeqc.dat")
#(2)
#phreeqc.load_database("C:\\Program Files (x86)\\USGS\\Phreeqc Interactive 3.3.3-10424\\database\\phreeqc.dat")
#(3)
#phreeqc.load_database(r"phreeqc.dat")
#(4)
phreeqc.load_database("phreeqc.dat")

Charlton, Scott

unread,
Nov 25, 2015, 4:49:11 PM11/25/15
to phreeqp...@googlegroups.com
I think you might be using an older phreeqc.dll that doesn't support some of the newer features in the current version of phreeqc (3.3.3).  Could you try using the wateq4f.dat database which doesn't use any of the new features.


--
You received this message because you are subscribed to the Google Groups ""phreeqpy-users" group.
To post to this group, send email to phreeqp...@googlegroups.com.
To unsubscribe from this group, send email to phreeqpy-user...@googlegroups.com.
For more options, visit this group at https://groups.google.com/d/forum/phreeqpy-users?hl=en.
 
More information about PhreeqPy can be found at http://www.phreeqpy.com.
---
You received this message because you are subscribed to the Google Groups "phreeqpy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phreeqpy-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Scott Charlton

charleywan2004

unread,
Nov 25, 2015, 8:05:54 PM11/25/15
to phreeqpy-users
Yes, it works. Thank you so much!

I used the database from version 2.18 and it worked.

Please let me know if phreeqpy is updated with the current version of phreeqc (3.3.3).
Reply all
Reply to author
Forward
0 new messages