IBM / federated-learning-lib

A library for federated learning (a distributed machine learning process) in an enterprise environment.
Other
499 stars 135 forks source link

install error for python=3.6 tensorflow=2.1.0 #93

Closed lmaxeniro closed 2 years ago

lmaxeniro commented 2 years ago

under conda env of "python=3.6.0 tensorflow=2.1.0" when install the federated_learning_lib-1.0.7-py3-none-any.whl, report below error: (p36_tf21) liangma@lMa-X1:~/prj/federated-learning-lib/federated-learning-lib$ pip install federated_learning_lib-1.0.7-py3-none-any.whl Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Processing ./federated_learning_lib-1.0.7-py3-none-any.whl ERROR: Exception: Traceback (most recent call last): File "/home/liangma/miniconda3/envs/p36_tf21/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 173, in _main status = self.run(options, args) File "/home/liangma/miniconda3/envs/p36_tf21/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 203, in wrapper return func(self, options, args) File "/home/liangma/miniconda3/envs/p36_tf21/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 316, in run reqs, check_supported_wheels=not options.target_dir File "/home/liangma/miniconda3/envs/p36_tf21/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve collected.requirements, max_rounds=try_to_avoid_resolution_too_deep File "/home/liangma/miniconda3/envs/p36_tf21/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 472, in resolve state = resolution.resolve(requirements, max_rounds=max_rounds) File "/home/liangma/miniconda3/envs/p36_tf21/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 341, in resolve self._add_to_criteria(self.state.criteria, r, parent=None) File "/home/liangma/miniconda3/envs/p36_tf21/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 168, in _add_to_criteria candidates=build_iter_view(matches), File "/home/liangma/miniconda3/envs/p36_tf21/lib/python3.6/site-packages/pip/_vendor/resolvelib/structs.py", line 164, in build_iter_view matches = list(matches) File "/home/liangma/miniconda3/envs/p36_tf21/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 417, in <genexpr> and all(req.is_satisfied_by(c) for req in requirements[identifier]) File "/home/liangma/miniconda3/envs/p36_tf21/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 417, in <genexpr> and all(req.is_satisfied_by(c) for req in requirements[identifier]) File "/home/liangma/miniconda3/envs/p36_tf21/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/requirements.py", line 39, in is_satisfied_by return candidate == self.candidate File "/home/liangma/miniconda3/envs/p36_tf21/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 172, in __eq__ return links_equivalent(self._link, other._link) File "/home/liangma/miniconda3/envs/p36_tf21/lib/python3.6/site-packages/pip/_internal/models/link.py", line 288, in links_equivalent return _CleanResult.from_link(link1) == _CleanResult.from_link(link2) AttributeError: type object '_CleanResult' has no attribute 'from_link'

Yi-Zoey commented 2 years ago

Hi @lmaxeniro, thanks for trying out IBM FL! I think this is an issue related to python version 3.6.0. You can try either updating your conda version, or running pip install -U pip, it should resolve the current issue.

lmaxeniro commented 2 years ago

What is the right python version you would recommend, for the current (git clone this branch) IBM FL and TensorFlow 2.1.0?

Yi-Zoey commented 2 years ago

We have tested TF 2.1.0 with python 3.6.0 and also 3.7.9.

lmaxeniro commented 2 years ago

Thanks, I now have the python 3.7.9 and tensorflow 2.1.0, When install

pip install federated_learning_lib-1.0.7-py3-none-any.whl

I meet such dependency error:

ERROR: Cannot install federated-learning-lib and federated-learning-lib==1.0.7 because these package versions have conflicting dependencies.

The conflict is caused by:
    federated-learning-lib 1.0.7 depends on numpy==1.17.4
    aif360 0.3.0 depends on numpy>=1.16
    gensim 3.8.3 depends on numpy>=1.11.3
    gym 0.19.0 depends on numpy>=1.18.0

This looks like a deadlock condition for the required numpy version by gym and federated-learning-lib

I can confirm that by using python 3.6.0 and tensorflow 2.1.0, install this whl file will report the same error.

Yi-Zoey commented 2 years ago

@lmaxeniro we have removed the numpy version requirement, can you pull the new WHL and try again?