to-requirements.txt
raw JSON → 2.0.14 verified Mon Apr 27 auth: no python
Automatically add and delete modules from requirements.txt when installing or uninstalling with pip. Current version: 2.0.14. Releases are monthly.
pip install to-requirements-txt Common errors
error pip: 'no-reqs-update' is not a valid option ↓
cause Older versions of pip do not support custom options from plugins.
fix
Upgrade pip to >=20.0 or use
PIP_NO_REQS_UPDATE=1 pip install ... environment variable. error ModuleNotFoundError: No module named 'to_requirements_txt' ↓
cause Trying to import the package directly; it's a pip plugin, not importable.
fix
Do not import it; just install it and use pip normally.
Warnings
gotcha The package is a pip plugin and does not work with pipx or virtual environments that use different pip paths. ↓
fix Run pip install/uninstall in the same environment where the package is installed (e.g., same virtualenv).
gotcha It can create duplicate entries if you manually edit requirements.txt then pip install. ↓
fix Use `pip install --no-reqs-update` to skip auto-update, or clean up manually.
deprecated The command-line tool 'to-requirements-txt' (as a script) is deprecated; only the pip plugin is maintained. ↓
fix Use pip install/uninstall normally; the plugin works automatically.
gotcha If you uninstall this package itself, it may also be removed from requirements.txt. ↓
fix Disable auto-update with `pip install --no-reqs-update to-requirements-txt` before uninstalling.
Imports
- to-requirements-txt wrong
import to_requirements_txtcorrectNo explicit import — the package works via pip plugins.
Quickstart
# After installation, pip operations automatically update requirements.txt
# Example: pip install requests # adds requests to requirements.txt
# Example: pip uninstall requests # removes requests from requirements.txt
# To disable temporarily: pip install --no-reqs-update requests