TL;DR: IPython removed passwd from IPython.lib. Import it from notebook.auth instead.

## The error
```text
ImportError: cannot import name 'passwd' from 'IPython.lib'
```

## Fix it
1. Replace the import:
   ```python
   from notebook.auth import passwd
   ```
   Expected: no import error.
2. For a version-proof script, gate it:
   ```python
   try:
       from notebook.auth import passwd
   except ImportError:
       from IPython.lib import passwd
   ```
3. Verify:
   ```
   python -c "from notebook.auth import passwd; print(passwd('x')[:6])"
   ```
   Expected: prints the start of a hash like argon2:.

## When this applies
Use this when a setup script does `from IPython.lib import passwd` on modern IPython.

## When it does not apply
If the error names a different IPython.lib member, look up its new home. If notebook is not installed, install it; notebook.auth is where the function lives now.

## Compatibility
Modern IPython (7+) with notebook installed. Very new jupyter_server-based setups moved it again to jupyter_server.auth; check if notebook.auth is absent.

## Root cause
passwd generated the password hash for the classic notebook server. When auth moved with the server code, IPython dropped its copy, and scripts importing the old path break.

## Edge cases
If you are hashing passwords for jupyter_server (not classic notebook), import from jupyter_server.auth instead. Never log or print full password hashes; they are secrets.