Python venv Troubleshooting Cheat Sheet/Confirm imports after rebuild

Smoke-test a rebuilt environment quickly.

Section: Full environment reset

Confirm imports after rebuild

bash
bash
python -c "import pkgutil; print('requests' in [m.name for m in pkgutil.iter_modules()])"
Explanation

A quick example of checking whether an expected package is visible after reinstall.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Full environment reset
Delete and recreate on POSIX
Start fresh from requirements.
OpenIn sheetbashsame section
Delete and recreate on PowerShell
Rebuild from scratch on Windows.
OpenIn sheetpowershellsame section
Find python on POSIX
See which python binary your shell resolves first.
Activate using bash syntax
Source the activate script in bash or zsh.
Install bundled pip
Bootstrap pip into the current interpreter or venv.
Find pip on POSIX
See which pip binary your shell resolves first.