{"id":24238,"library":"pip-check-reqs","title":"pip-check-reqs","description":"A tool to find packages that should or should not be in requirements for a Python project. It checks for missing dependencies (packages imported but not listed) and unused packages (listed but not imported). Current version 2.5.6, requires Python >=3.9, actively maintained.","status":"active","version":"2.5.6","language":"python","source_language":"en","source_url":"https://github.com/adamtheturtle/pip-check-reqs","tags":["requirements","dependencies","linter","pip"],"install":[{"cmd":"pip install pip-check-reqs","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"The module is imported as a whole; no specific class/function imports are standard. Use command-line tool.","wrong":"","symbol":"pip_check_reqs","correct":"import pip_check_reqs"}],"quickstart":{"code":"pip install pip-check-reqs\npip-check-reqs check-requirements -r requirements.txt\npip-check-reqs find-unused -r requirements.txt","lang":"bash","description":"Basic usage: check for missing dependencies and find unused packages in a requirements file."},"warnings":[{"fix":"Manually verify dynamic imports or use a more comprehensive tool like `pip-audit` or `safety`.","message":"The tool only analyses static imports as reported by `pip freeze` and static analysis of import statements. Dynamic imports (e.g., `importlib.import_module()`) are not detected. You may miss dependencies if your code uses dynamic imports.","severity":"gotcha","affected_versions":"all"},{"fix":"Always run in a virtual environment where all project dependencies are installed via `pip install -r requirements.txt`.","message":"Running `pip-check-reqs` on a project without first installing all dependencies in the same environment will give false positives/negatives. The tool relies on locally installed packages to match against imports.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `pip-check-reqs check-requirements -r requirements.txt` instead of `--requirements requirements.txt`.","message":"The `--requirements` flag is deprecated in favor of `-r`. In version 2.5.6, `--requirements` still works but may be removed in the future.","severity":"deprecated","affected_versions":"2.5.x"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Fix the requirements file to comply with PEP 508 format. Example: 'package>=1.0' not 'package >=1.0' with extra spaces.","cause":"Invalid syntax or malformed line in requirements.txt (e.g., missing version specifier).","error":"pip._vendor.pkg_resources.RequirementParseError: Invalid requirement, parse error in ..."},{"fix":"Install the missing package via `pip install some_package` or add it to requirements.txt.","cause":"The tool cannot find an imported module in the environment because it is not installed.","error":"ModuleNotFoundError: No module named 'some_package'"},{"fix":"Run `pip install -r requirements.txt` to install all listed packages.","cause":"The package listed in requirements.txt is not installed in the current environment.","error":"pip_check_reqs.exceptions.PackageNotFoundError: Package 'some-package' not found in environment"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}