Python Dependency Conflict Checker - Check before you install
PyConflict checks Python package dependency constraints before installation. It supports PEP 508 environment markers, installed-environment audits, batch checks, and integrations for AI coding tools.
It answers one question: "Will adding this package conflict with versions already installed?"
Unlike existing tools that detect conflicts after installation, PyConflict is proactive - it checks dependencies before making changes.
# requirements.txt pins django==3.2 and asgiref==3.2.0 $ python -m pip install -r requirements.txt ERROR: django==3.2 requires asgiref>=3.3.2,<4, but asgiref==3.2.0 is pinned The Solution:
$ pyconflict check-add django==3.2 ✗ Cannot add django==3.2 Conflicts detected: • asgiref Required: =3.3.2 Installed: 3.2.0 Suggestions: → Upgrade 'asgiref' from 3.2.0 to satisfy django's requirement ( =3.3.2) Features ✅ Proactive conflict detection - Check dependency constraints before installing ✅ AI-assistant friendly - JSON output for Claude Code, Cursor, Copilot ✅ Editor integrations - Cursor instructions, an MCP server, and a VS Code extension ✅ PEP 508 markers - Ignore requirements that do not apply to the selected Python and platform ✅ Cached PyPI metadata - Reuse package data between checks ✅ Direct dependencies - Checks package's immediate dependencies against installed versions ✅ Latest stable version - Find the newest non-prerelease version ✅ Clean Architecture - Maintainable, testable, extensible codebase ✅ Tests - Unit and integration test suites are included Current limits check-add checks direct dependencies. It does not resolve transitive dependencies. Optional extras such as package[security] are not included. batch-check accepts package names and exact == pins only. Private package indexes are not supported. Installation From source (current) git clone https://github.com/alimoradi296/PyConflict.git cd PyConflict python -m pip install . PyConflict does not have a published PyPI release yet. The PyPI install command will be added here after a release is published.
python -m pip install -e ".[dev]" Verify Installation pyconflict --help Quick Start Check if a package is safe to add # Check latest version $ pyconflict check-add tensorflow # Check specific version $ pyconflict check-add django==3.2 # JSON output (for AI tools) $ pyconflict check-add requests --json Get latest stable version # Latest version $ pyconflict stable pandas # Filter by Python version $ pyconflict stable numpy --python-version 3.8 Check the installed environment and multiple package candidates pyconflict check-env --json pyconflict batch-check -p django -p "requests==2.31.0" --json batch-check accepts package names or exact == pins. It rejects version ranges, extras, and environment markers.
From the repository checkout, install Redis support with python -m pip install ".[team]", then configure PYCONFLICT_WORKSPACE_ID and PYCONFLICT_REDIS_URL. Compare the current environment with a saved baseline by running pyconflict team-check. To explicitly save the current package names and versions as the shared baseline, run pyconflict team-check --set-standard. Saving sends those names and versions to the configured Redis service; a normal check only reads the baseline.
Check if adding a package will cause conflicts with your current environment.
pyconflict check-add [OPTIONS] Options:
# Safe to add $ pyconflict check-add fastapi ✓ Safe to add fastapi==0.104.1 # Conflict detected $ pyconflict check-add django==3.2 ✗ Cannot add django==3.2 Conflicts detected: • asgiref Required: =3.3.2 Installed: 3.2.0 Suggestions: → Upgrade 'asgiref' from 3.2.0 to satisfy django's requirement ( =3.3.2) # JSON output $ pyconflict check-add django==3.2 --json { "status": "conflict", "exit_code": 1, "package": { "name": "django", "version": "3.2.0" }, "conflicts": [ { "dependency": "asgiref", "required": " =3.3.2", "installed": "3.2.0", "required_by": "django==3.2.0", "severity": "error" } ], "suggestions": [ "Upgrade 'asgiref' from 3.2.0 to satisfy django's requirement ( =3.3.2)" ], "caveats": [ "Only direct dependencies checked (not transitive)", "Optional extras not included" ] } Command: stable Get the latest stable (non-prerelease) version of a package.
pyconflict stable [OPTIONS] Options:
$ pyconflict stable pandas pandas==2.1.4 $ pyconflict stable numpy --python-version 3.8 numpy==1.24.4 (filtered by Python version) AI Assistant Integration For Claude Code PyConflict is designed to be called by AI coding assistants:
# Claude internally runs: result=$(pyconflict check-add tensorflow --json) exit_code=$? if [ $exit_code -eq 0 ]; then echo "tensorflow==2.15.0" >> requirements.txt else # Show conflict to user echo "Cannot add tensorflow: conflicts detected" fi For Cursor Add to .cursor/rules:
Before adding Python packages: 1. Run: pyconflict check-add --json 2. Only proceed if exit_code == 0 Architecture PyConflict follows Clean Architecture principles:
┌─────────────────────┐ │ CLI (Typer) │ ← Presentation Layer └──────────┬──────────┘ │ ┌──────────▼──────────┐ │ Use Cases │ ← Application Layer │ • CheckAddPackage │ │ • GetLatestStable │ └──────────┬──────────┘ │ ┌──────────▼──────────┐ │ Domain Services │ ← Domain Layer │ • ConflictDetector │ │ • VersionResolver │ └──────────┬──────────┘ │ ┌──────────▼──────────┐ │ Infrastructure │ ← Infrastructure Layer │ • PyPI Repository │ │ • Disk Cache │ │ • Pip Environment │ └─────────────────────┘ Key benefits:
The timings above are targets and have not been verified for this checkout.
# Clone the repository git clone https://github.com/alimoradi296/PyConflict.git cd PyConflict # Create virtual environment python -m venv venv source venv/bin/activate # or venv\Scripts\activate on Windows # Install in development mode pip install -e ".[dev]" Running Tests # Run all tests pytest # Run with coverage pytest --cov=pyconflict --cov-report=html # Run only unit tests (fast) pytest tests/unit -v # Run integration tests (requires network) pytest tests/integration -v -m integration # Run specific test pytest tests/unit/domain/test_version_resolver.py Code Quality # Format code black src tests # Lint ruff check src tests # Type check mypy src # Run all checks (CI simulation) black --check src tests && ruff check src tests && mypy src && pytest Limitations PyConflict checks direct dependencies for check-add and installed distribution requirements for check-env:
Accuracy is not measured. The tool checks direct dependency constraints against the current environment. It does not resolve the full dependency graph.
PyConflict does not report a confidence percentage. Its checks cover documented inputs; they are not a guarantee that an installation will succeed.
See Roadmap for current priorities.
See ROADMAP.md for current project priorities.
Q: How is this different from pip check? A: pip check is reactive - it checks for conflicts after installation. PyConflict is proactive - it checks before you install.
Q: Does it work with private PyPI repositories? A: No. PyConflict currently reads package metadata from public PyPI.
Q: Can it automatically fix conflicts? A: No. PyConflict provides suggestions, but you decide what to do. Automatic fixes are too risky.
Q: How accurate is it? A: We have not measured accuracy. check-add checks direct dependencies and evaluates their environment markers. It does not check transitive dependencies or optional extras.
Q: Does it replace poetry/pip-tools? A: No. PyConflict is a checker, not a package manager or lock file tool. Use it alongside your existing tools.
Contributions are welcome! We need help with:
Please see CONTRIBUTING.md for guidelines.
MIT License - see LICENSE for details.
If PyConflict saves you time, please give it a star on GitHub!
Made with ❤️ for Python developers and AI coding assistants
Both files in this release have provenance metadata.
dependency conflict checker python pip pypi pep508 dependency-management cli ai mcp cursor vscode claude-code
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Both files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Nov 22, 2026 2 release files Full provenance




