Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency Issue in example - Vertical FL #4722

Closed
TheVidz opened this issue Dec 16, 2024 · 4 comments
Closed

Dependency Issue in example - Vertical FL #4722

TheVidz opened this issue Dec 16, 2024 · 4 comments

Comments

@TheVidz
Copy link
Contributor

TheVidz commented Dec 16, 2024

Describe the bug

There is a dependency conflict in the example for 'vertical-fl'. The following error is received on pip install -e .
Screenshot from 2024-12-16 23-41-55

Steps/Code to Reproduce

After following the steps given in README of vertical-fl:
Start by cloning the example project:

git clone --depth=1 https://github.com/adap/flower.git _tmp \
        && mv _tmp/examples/vertical-fl . \
        && rm -rf _tmp \
        && cd vertical-fl

This will create a new directory called vertical-fl with the following structure: following files:

vertical-fl
├── vertical_fl
│   ├── __init__.py
│   ├── client_app.py   # Defines your ClientApp
│   ├── server_app.py   # Defines your ServerApp
│   ├── strategy.py     # Defines your Strategy
│   └── task.py         # Defines your model, training and data loading
├── pyproject.toml      # Project metadata like dependencies and configs
├── data/train.csv
└── README.md

Install dependencies and project

Install the dependencies defined in pyproject.toml as well as the mlxexample package.

pip install -e .

Expected Results

The result expected is that The required packages are installed.
But here encountered dependency conflict.

Actual Results

The following error is encountered:

INFO: pip is looking at multiple versions of numpy to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of vertical-fl to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install flwr-datasets, flwr[simulation]==1.13.1, vertical-fl and vertical-fl==1.0.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    vertical-fl 1.0.0 depends on numpy==1.24.4
    pandas 2.0.3 depends on numpy>=1.21.0; python_version >= "3.10"
    scikit-learn 1.3.2 depends on numpy<2.0 and >=1.17.3
    flwr-datasets 0.3.0 depends on numpy<2.0.0 and >=1.21.0
    pyarrow 16.1.0 depends on numpy>=1.16.6
    flwr[simulation] 1.13.1 depends on numpy<3.0.0 and >=1.26.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
@TheVidz
Copy link
Contributor Author

TheVidz commented Dec 16, 2024

Oh I was able to successfully install
If I change the pyproject.toml file:

    "flwr[simulation]>=1.13.1",
    "flwr-datasets>=0.3.0",
    "numpy==1.24.4",
    "pandas==2.0.3",
    "scikit-learn==1.3.2",
    "torch==2.1.0",
]

If I change the numpy dependency to >=1.24.4 instead of ==1.24.4,
This could solve the dependency conflict with flwr[simulation] depending on numpy>=1.26.0

Kindly tell if this is a valid fix?

@jafermarq
Copy link
Contributor

Hi @TheVidz, thanks for opening the issue. This issue arises because until recently flower had to use numpy<2.0 but we removed this limitation a couple of releases ago. I'm inclined to say that if we can remove the numpy specification in the pyproject.toml that's even better.

If you have time, could you open a PR with that fix? I think the same will be needed for the quickstart-pandas example

@TheVidz
Copy link
Contributor Author

TheVidz commented Dec 16, 2024

Sure, I will open a PR removing the numpy specification right now, thank you for explaining!

@jafermarq
Copy link
Contributor

Closing, many thanks once more for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants