{"id":28246,"library":"spotpy","title":"spotpy - A Statistical Parameter Optimization Tool","description":"spotpy is a Python library for statistical parameter optimization, calibration, and sensitivity analysis of environmental models. It provides a range of algorithms including Monte Carlo, Markov chain Monte Carlo (MCMC), Shuffled Complex Evolution (SCE-UA), DREAM, and various sensitivity analysis methods like FAST and Morris. Current version: 1.6.7. Release cadence is irregular, with several minor releases in recent years.","status":"active","version":"1.6.7","language":"python","source_language":"en","source_url":"https://github.com/thouska/spotpy","tags":["optimization","parameter estimation","sensitivity analysis","mcmc","calibration","environmental modeling"],"install":[{"cmd":"pip install spotpy","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency for numerical operations","package":"numpy","optional":false},{"reason":"Required for optimization and statistical functions","package":"scipy","optional":false},{"reason":"Used for plotting results in tutorials and some algorithms","package":"matplotlib","optional":true}],"imports":[{"note":"The main module is imported directly as 'spotpy'.","wrong":null,"symbol":"spotpy","correct":"import spotpy"},{"note":"spotpy_setup is a module inside spotpy.examples, not a top-level package.","wrong":"import spotpy_setup","symbol":"spotpy_setup","correct":"from spotpy.examples import spotpy_setup as setup"},{"note":"demcz is a submodule inside spotpy, not a standalone package.","wrong":"import demcz","symbol":"demcz","correct":"from spotpy import demcz"}],"quickstart":{"code":"import spotpy\nfrom spotpy.examples.spotpy_setup_hymod import spotpy_setup as setup\n\n# Create a test setup\nspotpy_setup = setup()\n\n# Select algorithm (here: Monte Carlo)\nsampler = spotpy.algorithms.mc(spotpy_setup, dbname='MC_test', dbformat='csv')\nsampler.sample(100)\n\n# Get results\nresults = sampler.getdata()\nprint(results.keys())","lang":"python","description":"Basic Monte Carlo sampling using spotpy with a built-in example setup (HYMOD model)."},"warnings":[{"fix":"Update pip and setuptools: pip install --upgrade pip setuptools. Or use 'pip install -e . --no-use-pep517' if needed.","message":"Migration to pyproject.toml in v1.6.1 removed setup.py. Installations via 'pip install -e .' may require setuptools update or use of 'pip install -e . --no-use-pep517'.","severity":"breaking","affected_versions":">=1.6.1"},{"fix":"Upgrade to Python 3.10 or higher.","message":"Python 2 support was removed in v1.6.1. Python 3.6+ is required, but the current version specifies Python >=3.10.","severity":"deprecated","affected_versions":">=1.6.1"},{"fix":"Set random_state to an integer, e.g., sampler = spotpy.algorithms.dream(..., random_state=42).","message":"When using the DREAM algorithm, the 'random_state' parameter must be an integer for reproducible results. Passing None leads to non-reproducible chains.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use: from spotpy.examples.spotpy_setup_hymod import spotpy_setup as setup","cause":"user tries to import spotpy_setup directly as a top-level module, but it is inside spotpy.examples.","error":"ModuleNotFoundError: No module named 'spotpy_setup'"},{"fix":"Import spotpy first, then use spotpy.algorithms.mc(...) or from spotpy.algorithms import mc","cause":"Old code that directly imports spotpy.algorithms without importing spotpy first, or incorrect import path.","error":"AttributeError: module 'spotpy' has no attribute 'algorithms'"},{"fix":"Use lowercase: dbformat='csv'","cause":"Database format is case-sensitive. 'csv' is correct, but some users may accidentally use 'CSV' or 'Csv'.","error":"ValueError: Unknown database format 'csv'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}