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

[BUG] Package conflict issue when installing flower and nvflare #2810

Closed
hwpang opened this issue Aug 19, 2024 · 3 comments · Fixed by #2822
Closed

[BUG] Package conflict issue when installing flower and nvflare #2810

hwpang opened this issue Aug 19, 2024 · 3 comments · Fixed by #2822
Labels
bug Something isn't working

Comments

@hwpang
Copy link
Contributor

hwpang commented Aug 19, 2024

Describe the bug
I am trying to run the hello-flower example at NVFlare/examples/hello-world/hello-flower. I run pip install -r requirements.txt, but run into conflicting dependency issues. Please see below for the error trace.

To Reproduce
Steps to reproduce the behavior:

  1. Go to NVFlare/examples/hello-world/hello-flower
  2. Make a clean, empty environment. I use conda create --name=nvflare_env python=3.10
  3. Install requirements with pip install -r requirements.txt
  4. See error

Expected behavior
Expected to install packages without issues.

Screenshots

INFO: pip is still looking at multiple versions of flwr to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install -r requirements.txt (line 1) and flwr because these package versions have conflicting dependencies.

The conflict is caused by:
    nvflare 2.5.0rc1 depends on protobuf==4.24.4
    flwr 1.10.0 depends on protobuf<5.0.0 and >=4.25.2
    nvflare 2.5.0rc1 depends on protobuf==4.24.4
    flwr 1.9.0 depends on protobuf<5.0.0 and >=4.25.2
    nvflare 2.5.0rc1 depends on protobuf==4.24.4
    flwr 1.8.0 depends on protobuf<5.0.0 and >=4.25.2

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

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Python Version: 3.10
  • NVFlare Version: 2.5.0rc1

Additional context
Add any other context about the problem here.

@hwpang hwpang added the bug Something isn't working label Aug 19, 2024
@hwpang
Copy link
Contributor Author

hwpang commented Aug 20, 2024

I tried switching to the newest main branch and did pip install ./jobs/hello-flwr-pt/app/custom as instructed in NVFlare/examples/hello-world/hello-flower/README.md, and got a different error:

Processing ./jobs/hello-flwr-pt/app/custom
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
INFO: pip is looking at multiple versions of flwr-pt to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement flwr<2.0,>=1.11.0 (from flwr-pt) (from versions: 0.1.0, 0.1.1, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.9.0, 0.10.0, 0.11.0, 0.12.0, 0.13.0, 0.14.0, 0.15.0, 0.16.0, 0.17.0, 0.18.0, 0.19.0, 1.0.0a0, 1.0.0rc0, 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0, 1.10.0)
ERROR: No matching distribution found for flwr<2.0,>=1.11.0

@berryfanta
Copy link

berryfanta commented Aug 21, 2024

flwr-nvflare integration is relatively new, my guess is that the stable releases have not yet caught up with the example. i suggest you try the nightly/source versions.

your error indicates:

  1. nvflare protobuf and flwr protobuf requirements are not compatible
  2. there does not exist a stable flwr>=1.11.0

here is a solution:

Install nvflare from source

  • git clone https://github.com/NVIDIA/NVFlare.git
  • cd NVFlare
  • modify following line
    protobuf==4.24.4

    to: protobuf==4.25.4
  • pip install .

Install flower nightly

  • pip install flwr-nightly

Install example app

dependencies = [
    "torch==2.2.1",
    "torchvision==0.17.1",
]
  • pip install ./jobs/hello-flwr-pt/app/custom

Not sure what downstream errors this hacked solution may cause though. Only concern from my perspective are the protobuf dependencies, but that could be a major difference for how communications are being handled. Maybe @yanchengnv can confirm

@yanchengnv
Copy link
Collaborator

Yes, this feature is still under development, as we speak. Once Flower and Flare versions become stable, we'll update the examples. Thanks for your interest!

Thanks for pointing out potential protobuf version conflict. We'll make sure it's resolved.

@YuanTingHsieh YuanTingHsieh linked a pull request Aug 21, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants