Skip to content

Installation

PhreeqPython is available on PyPI and can be installed with pip or uv. The wheel comes bundled with a VIPhreeqc shared library and several default databases, so you do not need a separate PHREEQC install.

pip install -U phreeqpython
uv add phreeqpython

Or, without a project:

uv pip install phreeqpython

Platforms

PhreeqPython is 64-bit only and ships a native library per platform:

Platform Library Notes
Windows viphreeqc.dll Needs the Visual C++ Redistributable 2015 (or later 2015–2022)
macOS viphreeqc.dylib
Linux viphreeqc.so
WebAssembly viphreeqcwasm.so Pyodide / browser (used by these docs)

Requires Python 3 (64-bit). There is no 32-bit build.

Dependencies

Installed automatically with the package:

Optional: kinetics

solution.kinetics() uses SciPy to integrate a Python rate function:

pip install 'phreeqpython[kinetics]'
uv add 'phreeqpython[kinetics]'

That extra only adds scipy. It is not PHREEQC's KINETICS keyword.

From source

git clone https://github.com/Vitens/phreeqpython.git
cd phreeqpython
pip install .

Latest master without cloning:

pip install git+https://github.com/Vitens/phreeqpython.git
git clone https://github.com/Vitens/phreeqpython.git
cd phreeqpython
uv pip install .

Latest master without cloning:

uv add git+https://github.com/Vitens/phreeqpython.git

Check the install

from phreeqpython import PhreeqPython

pp = PhreeqPython()
print(pp.add_solution({'pH': 7}).pH)

If the native library cannot be loaded on Windows, install the Visual C++ Redistributable linked above and retry.

Next: Running an analysis.