Skip to main content

Fix your Python dependency conflicts automatically

Project description

๐Ÿ”ง Reqfix

Fix your Python dependency conflicts automatically.

Python License: MIT PyPI


The Problem

You clone a Python project, create a virtual environment, run pip install -r requirements.txt and get this:

ERROR: Cannot install flask==1.0.0 and werkzeug==2.3.0 because these
package versions have conflicting dependencies.

Then you spend the next hour manually hunting for compatible versions. It's tedious, frustrating, and happens to every developer.


The Solution

Reqfix analyzes your requirements.txt, talks to PyPI, finds compatible versions for every package, verifies they all work together, and installs them.

reqfix install

That's it.


โœจ Features

  • ๐Ÿ” Analyze โ€” Detects conflicts, unpinned packages, and outdated versions
  • ๐Ÿ”ง Fix โ€” Generates a clean requirements.fixed.txt with pinned compatible versions
  • ๐Ÿš€ Install โ€” Auto-installs all fixed packages in one command
  • ๐Ÿ›ก๏ธ Verify โ€” Cross-checks ALL packages are mutually compatible before installing anything
  • ๐ŸŽจ Beautiful output โ€” Color-coded terminal reports powered by Rich

๐Ÿ“ฆ Installation

Option 1 โ€” Via pip (recommended)

pip install reqfix

Option 2 โ€” From source (for contributors)

git clone https://github.com/Sakshi-512/reqfix.git
cd reqfix
pip install -e .

๐Ÿ’ก Install globally (outside any virtualenv) so reqfix is available in every project.


๐Ÿš€ Usage

The most common flow

# You cloned a project and pip install failed?
# Just run:
reqfix install

Analyze โ€” see what's broken (no changes made)

reqfix analyze
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚  Reqfix โ€” Python Dependency Doctor      โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Found 4 packages in requirements.txt

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Package     โ”‚ Original   โ”‚ Status      โ”‚ Suggested Fix        โ”‚ Reason                               โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ flask       โ”‚ >=2.0.0    โ”‚ โœ… Healthy   โ”‚ flask==3.1.2         โ”‚ Pinned to latest compatible version  โ”‚
โ”‚ requests    โ”‚ ==2.28.1   โ”‚ โœ… Healthy   โ”‚ requests==2.28.1     โ”‚ Pinned to latest compatible version  โ”‚
โ”‚ numpy       โ”‚ none       โ”‚ ๐Ÿ“Œ Unpinned  โ”‚ numpy==2.4.2         โ”‚ Pinned to latest stable              โ”‚
โ”‚ pandas      โ”‚ >=1.3.0    โ”‚ โœ… Healthy   โ”‚ pandas==3.0.0        โ”‚ Pinned to latest compatible version  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

  ๐Ÿ’ฅ Conflicts: 0   ๐Ÿ“Œ Unpinned: 1   โœ… Healthy: 3

โœ… All packages verified โ€” no cross-package conflicts.

Fix โ€” generate a clean requirements file

reqfix fix

Writes a requirements.fixed.txt with every package pinned to a compatible version. Nothing is installed.

Install โ€” fix and install in one step

reqfix install

Asks for confirmation, verifies cross-package compatibility, then installs everything.

Custom file paths

reqfix analyze --file path/to/requirements.txt
reqfix fix --output my-fixed-requirements.txt

๐Ÿ—บ๏ธ Roadmap

This is just the beginning. Here's what's coming:

  • v0.2 โ€” Parallel PyPI requests (faster analysis)
  • v0.3 โ€” Support for pyproject.toml and setup.py
  • v0.4 โ€” Conflict graph visualization
  • v1.0 โ€” SaaS web app with team features
  • v1.x โ€” VS Code extension with inline conflict highlighting

๐Ÿค Contributing

Contributions are welcome! This project is actively developed.

  1. Fork the repo
  2. Create a branch: git checkout -b feat/your-feature
  3. Make your changes
  4. Push and open a Pull Request

Please follow the existing code style โ€” type hints, docstrings, and single-responsibility functions throughout.


๐Ÿ“ Project Structure

reqfix/
โ”œโ”€โ”€ core/
โ”‚   โ”œโ”€โ”€ parser.py      # Parses requirements.txt into objects
โ”‚   โ”œโ”€โ”€ resolver.py    # Fetches versions from PyPI, detects conflicts
โ”‚   โ”œโ”€โ”€ fixer.py       # Determines best version for each package
โ”‚   โ”œโ”€โ”€ verifier.py    # Verifies all packages are mutually compatible
โ”‚   โ””โ”€โ”€ installer.py   # Writes fixed file and runs pip install
โ”œโ”€โ”€ cli/
โ”‚   โ””โ”€โ”€ main.py        # Terminal interface (analyze, fix, install)
โ”œโ”€โ”€ setup.py           # Package configuration
โ””โ”€โ”€ requirements.txt   # Reqfix's own dependencies

๐Ÿ“„ License

MIT โ€” free to use, modify, and distribute.


Built with โค๏ธ to save developers from dependency hell

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reqfix-0.1.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reqfix-0.1.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file reqfix-0.1.0.tar.gz.

File metadata

  • Download URL: reqfix-0.1.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for reqfix-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7e9d575a7c7fa540796522baf5ada4e6a006738af9233c6e2a0e46b7ac8e34c0
MD5 08839a1e4f352b49fe65775935e1f484
BLAKE2b-256 cb3e1e6f0ce492d7683d366d30446312a47deb32fcc7023ad3430dbbd47071e2

See more details on using hashes here.

File details

Details for the file reqfix-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: reqfix-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for reqfix-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ddef170bb45adfeb770d3656f4f14c1ff73f5993dfa1bad8749d0255a7fda91
MD5 c74366badba459109cebec070ca521e3
BLAKE2b-256 64acc53272b506b0741199f2e0d9ece7767841ac788b5336aab2a61559316157

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page