{"id":22468,"library":"to-requirements-txt","title":"to-requirements.txt","description":"Automatically add and delete modules from requirements.txt when installing or uninstalling with pip. Current version: 2.0.14. Releases are monthly.","status":"active","version":"2.0.14","language":"python","source_language":"en","source_url":"https://github.com/VoIlAlex/rex","tags":["pip","requirements.txt","plugin","auto-update","dependencies"],"install":[{"cmd":"pip install to-requirements-txt","lang":"bash","label":"Standard install"}],"dependencies":[],"imports":[{"note":"This is a pip plugin, not a regular Python module. Importing it does nothing.","wrong":"import to_requirements_txt","symbol":"to-requirements-txt","correct":"No explicit import — the package works via pip plugins."}],"quickstart":{"code":"# After installation, pip operations automatically update requirements.txt\n# Example: pip install requests  # adds requests to requirements.txt\n# Example: pip uninstall requests  # removes requests from requirements.txt\n# To disable temporarily: pip install --no-reqs-update requests","lang":"bash","description":"The tool hooks into pip install/uninstall and automatically syncs requirements.txt."},"warnings":[{"fix":"Run pip install/uninstall in the same environment where the package is installed (e.g., same virtualenv).","message":"The package is a pip plugin and does not work with pipx or virtual environments that use different pip paths.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `pip install --no-reqs-update` to skip auto-update, or clean up manually.","message":"It can create duplicate entries if you manually edit requirements.txt then pip install.","severity":"gotcha","affected_versions":"all"},{"fix":"Use pip install/uninstall normally; the plugin works automatically.","message":"The command-line tool 'to-requirements-txt' (as a script) is deprecated; only the pip plugin is maintained.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Disable auto-update with `pip install --no-reqs-update to-requirements-txt` before uninstalling.","message":"If you uninstall this package itself, it may also be removed from requirements.txt.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Upgrade pip to >=20.0 or use `PIP_NO_REQS_UPDATE=1 pip install ...` environment variable.","cause":"Older versions of pip do not support custom options from plugins.","error":"pip: 'no-reqs-update' is not a valid option"},{"fix":"Do not import it; just install it and use pip normally.","cause":"Trying to import the package directly; it's a pip plugin, not importable.","error":"ModuleNotFoundError: No module named 'to_requirements_txt'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}