OpenMined / openmined

OpenMined courses application

Home Page:https://courses.openmined.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pip install git+https://github.com/OpenMined/PySyft@dev#egg=syft does not work

fcossio opened this issue · comments

Description

When trying to install syft though the command pip install git+https://github.com/OpenMined/PySyft@dev#egg=syft as suggested in "Federated Learning | Concept 13 Duet Exercises: Setup" the following error is returned.

WARNING: Generating metadata for package syft produced metadata for project name unknown. Fix your #egg=syft fragments.
WARNING: Discarding git+https://github.com/OpenMined/PySyft@dev#egg=syft. Requested unknown from git+https://github.com/OpenMined/PySyft@dev#egg=syft has inconsistent name: filename has 'syft', but metadata has 'UNKNOWN'
ERROR: Could not find a version that satisfies the requirement syft (unavailable) (from versions: 0.1.0a1, 0.1.1a2, 0.1.2a1, 0.1.3a1, 0.1.4a1, 0.1.4a2, 0.1.5a1, 0.1.6a1, 0.1.7a1, 0.1.8a1, 0.1.9a1, 0.1.10a1, 0.1.10a2, 0.1.10a4, 0.1.11a1, 0.1.12a1, 0.1.13a1, 0.1.14a1, 0.1.15a1, 0.1.16a1, 0.1.19a1, 0.1.20a1, 0.1.21a1, 0.1.22a1, 0.1.23a1, 0.1.24a1, 0.1.25a1, 0.1.26a1, 0.1.27a1, 0.1.28a1, 0.1.29a1, 0.2.0a1, 0.2.0a2, 0.2.1a1, 0.2.2a1, 0.2.3a1, 0.2.3a2, 0.2.3a3, 0.2.3, 0.2.4, 0.2.5, 0.2.6, 0.2.7, 0.2.8, 0.2.9, 0.3.0, 0.5.0rc1)
ERROR: No matching distribution found for syft (unavailable)

If I try to install syft from pypi, I get the following error when importing syft

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/fer/miniconda3/envs/federated-learning/lib/python3.8/site-packages/syft/__init__.py", line 61, in <module>
    from syft.core.node.device.device import Device  # noqa: F401
  File "/home/fer/miniconda3/envs/federated-learning/lib/python3.8/site-packages/syft/core/node/device/__init__.py", line 2, in <module>
    from .client import DeviceClient
  File "/home/fer/miniconda3/envs/federated-learning/lib/python3.8/site-packages/syft/core/node/device/client.py", line 16, in <module>
    from ..common.client import Client
  File "/home/fer/miniconda3/envs/federated-learning/lib/python3.8/site-packages/syft/core/node/common/client.py", line 20, in <module>
    from ....lib import lib_ast
  File "/home/fer/miniconda3/envs/federated-learning/lib/python3.8/site-packages/syft/lib/__init__.py", line 26, in <module>
    lib_ast = create_lib_ast()
  File "/home/fer/miniconda3/envs/federated-learning/lib/python3.8/site-packages/syft/lib/__init__.py", line 12, in create_lib_ast
    torch_ast = create_torch_ast()
  File "/home/fer/miniconda3/envs/federated-learning/lib/python3.8/site-packages/syft/lib/torch/__init__.py", line 53, in create_torch_ast
    ast.add_path(
  File "/home/fer/miniconda3/envs/federated-learning/lib/python3.8/site-packages/syft/ast/globals.py", line 65, in add_path
    attr.add_path(  # type: ignore
  File "/home/fer/miniconda3/envs/federated-learning/lib/python3.8/site-packages/syft/ast/module.py", line 120, in add_path
    attr.add_path(  # type: ignore
  File "/home/fer/miniconda3/envs/federated-learning/lib/python3.8/site-packages/syft/ast/callable.py", line 82, in add_path
    attr_ref = getattr(self.ref, path[index])
AttributeError: type object 'Tensor' has no attribute 'fft'

How to Reproduce

Error 1:

conda create -n federated-learning python=3.8 -y
conda activate federated-learning
pip install git+https://github.com/OpenMined/PySyft@dev#egg=syft

Error 2:

conda create -n federated-learning python=3.8 -y
conda activate federated-learning
pip install syft
pip install jupyter
python
import syft

Expected Behavior

Install syft without errors

System Information

  • OS: ubuntu
  • OS Version: 20.04.1
  • Language Version: python 3.8, pip 21.1.1
  • Package Manager Version: conda 4.9.2

After taking a look at the new folder structure and investigating a bit about pip install git+https
https://stackoverflow.com/questions/13566200/how-can-i-install-from-a-git-subdirectory-with-pip
https://pip.pypa.io/en/stable/cli/pip_install/#git
This command is working for the installation of the dev branch in PySyft
pip install "git+https://github.com/OpenMined/PySyft@dev#egg=syft&subdirectory=packages/syft"
This also fixed the error when importing syft