{"id":24825,"library":"watermark","title":"watermark","description":"An IPython magic function to print date/time stamps, system information (e.g., Python version, OS, hardware), GPU details, and package versions. Current version: 2.6.0. Release cadence: irregular, ~1-2 releases per year.","status":"active","version":"2.6.0","language":"python","source_language":"en","source_url":"https://github.com/rasbt/watermark","tags":["ipython","jupyter","magic","system-info","versioning"],"install":[{"cmd":"pip install watermark","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Required for %watermark magic command in Jupyter/IPython","package":"ipython","optional":false},{"reason":"Optional dependency for GPU info (--gpu flag)","package":"py3nvml","optional":true}],"imports":[{"note":"watermark() function is separate from the IPython magic; available since v2.2.0","symbol":"watermark","correct":"from watermark import watermark"}],"quickstart":{"code":"# In a Jupyter/IPython notebook cell:\n%watermark -v -m -p numpy,scipy --gpu\n\n# Or in a regular Python script:\nfrom watermark import watermark\nprint(watermark())","lang":"python","description":"Prints Python version, machine info, package versions, and GPU info."},"warnings":[{"fix":"Use `from watermark import watermark` and call `watermark()` in scripts; for IPython magic, use `%watermark` as before.","message":"The `watermark()` function (non-magic) was added in v2.2.0. Importing `watermark` from the package returns the function, not the magic. The magic %watermark still works in IPython.","severity":"breaking","affected_versions":">=2.2.0"},{"fix":"Install py3nvml if GPU information is needed: `pip install py3nvml`.","message":"The `--gpu` flag requires `py3nvml` (optional). If not installed, watermark will ignore the flag without error.","severity":"deprecated","affected_versions":">=2.4.0"},{"fix":"Use the correct distribution name (e.g., scikit-learn) rather than the import module name.","message":"The `-p` flag expects package names, not import names. For example, use `-p scikit-learn`, not `-p sklearn`.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure packages are properly installed; avoid editable installs for version detection.","message":"Library version detection uses `pkg_resources` or `importlib.metadata`. If a package is installed in development mode (pip install -e), the version may be `0.0.0` or missing.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install with: pip install watermark","cause":"watermark is not installed.","error":"ModuleNotFoundError: No module named 'watermark'"},{"fix":"In IPython/Jupyter, run: %load_ext watermark","cause":"The watermark magic is not loaded; you may have forgotten to load the extension or run in an environment without IPython.","error":"UsageError: %watermark is not a valid IPython magic function."},{"fix":"Install setuptools: pip install setuptools","cause":"setuptools/pkg_resources is missing in the environment.","error":"KeyError: 'pkg_resources'"},{"fix":"Use the `watermark()` function from the module with appropriate keyword arguments, e.g., watermark(packages='numpy').","cause":"Attempting to call the magic function as a Python function with arguments incorrectly.","error":"TypeError: watermark() takes 0 positional arguments but 1 was given"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}