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

Failed to import syft #5370

Closed
TudouJack opened this issue Mar 25, 2021 · 11 comments
Closed

Failed to import syft #5370

TudouJack opened this issue Mar 25, 2021 · 11 comments
Labels
Type: Question ❔ Question about implementation or some technical aspect

Comments

@TudouJack
Copy link

Question

File "D:/PycharmProjects/HDFED/main.py", line 2, in
import syft as sy
File "C:\Users\xd_69\AppData\Roaming\Python\Python38\site-packages\syft_init_.py", line 61, in
from syft.core.node.device.device import Device # noqa: F401
File "C:\Users\xd_69\AppData\Roaming\Python\Python38\site-packages\syft\core\node\device_init_.py", line 2, in
from .client import DeviceClient
File "C:\Users\xd_69\AppData\Roaming\Python\Python38\site-packages\syft\core\node\device\client.py", line 16, in
from ..common.client import Client
File "C:\Users\xd_69\AppData\Roaming\Python\Python38\site-packages\syft\core\node\common\client.py", line 20, in
from ....lib import lib_ast
File "C:\Users\xd_69\AppData\Roaming\Python\Python38\site-packages\syft\lib_init_.py", line 26, in
lib_ast = create_lib_ast()
File "C:\Users\xd_69\AppData\Roaming\Python\Python38\site-packages\syft\lib_init_.py", line 12, in create_lib_ast
torch_ast = create_torch_ast()
File "C:\Users\xd_69\AppData\Roaming\Python\Python38\site-packages\syft\lib\torch_init_.py", line 53, in create_torch_ast
ast.add_path(
File "C:\Users\xd_69\AppData\Roaming\Python\Python38\site-packages\syft\ast\globals.py", line 65, in add_path
attr.add_path( # type: ignore
File "C:\Users\xd_69\AppData\Roaming\Python\Python38\site-packages\syft\ast\module.py", line 120, in add_path
attr.add_path( # type: ignore
File "C:\Users\xd_69\AppData\Roaming\Python\Python38\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'

System Information

  • OS: windows 10
  • Language Version:Python 3.8
  • Package Manager Version:Conda 4.9.2, pycharm, syft 0.3, torch1.8.0

I followed the README to install the syft, but I can not import it successfully. Please tell me what else I need to do to make the environment correct. Thanks!

@TudouJack TudouJack added the Type: Question ❔ Question about implementation or some technical aspect label Mar 25, 2021
@madhavajay
Copy link
Collaborator

Did you install syft with?

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

@TudouJack
Copy link
Author

Did you install syft with?

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

thank u soooooooooooooooooooooo much!!!

@RomainGoussault
Copy link

Hello, I had the same issue and your proposition worked @madhavajay, thanks!
But why do we have to that and why pip install syft alone does not work?

@TudouJack
Copy link
Author

Hello, I had the same issue and your proposition worked @madhavajay, thanks!
But why do we have to that and why pip install syft alone does not work?

Maybe it is because the packge installed by pip is an old version which is different from https://github.com/OpenMined/PySyft@dev#egg=syft

@vnt1537
Copy link

vnt1537 commented May 5, 2021

It is mos

Hello, I had the same issue and your proposition worked @madhavajay, thanks!
But why do we have to that and why pip install syft alone does not work?

It is mostly because of the torch version!
We need torch version <=1.7.0 & >=1.4.0 and torchvision<=0.9 & >=0.5 .

@youngfish42
Copy link

youngfish42 commented May 20, 2021

It is mos

Hello, I had the same issue and your proposition worked @madhavajay, thanks!
But why do we have to that and why pip install syft alone does not work?

It is mostly because of the torch version!
We need torch version <=1.7.0 & >=1.4.0 and torchvision<=0.9 & >=0.5 .

I also had to deal with this problem.
My system information as follows:

OS: windows 10
Language Version:Python 3.7
Package Manager Version: syft 0.3, torch1.8.1

I tried to downgrade torch==1.7.0 and torchvision==0.8.1

an installation with CUDA
pip install torch===1.7.0 torchvision===0.8.1 torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

an installation without CUDA
pip install torch==1.7.0+cpu torchvision==0.8.1+cpu torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

And it works.

@mkeshav
Copy link

mkeshav commented Jun 17, 2021

File "setup.py" or "setup.cfg" not found for legacy project syft from git+https://github.com/OpenMined/PySyft@dev#egg=syft

I get above error when i try to install using pip install git+https://github.com/OpenMined/PySyft@dev#egg=syft

@phenomenal-manish
Copy link

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

ERROR: File "setup.py" not found for legacy project syft from git+https://github.com/OpenMined/PySyft@dev#egg=syft.

@tushar-madheshia
Copy link

I was also getting the same error as @mkeshav and @phenomenal-manish . I tried installing an earlier version using pip and it worked for me.

pip install syft==0.5.0

https://pypi.org/project/syft/0.6.0/#history

@Nazmul92
Copy link

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

When I tried using ! pip install git+https://github.com/OpenMined/PySyft@dev#egg=syft in colab.

The error:
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting syft
Cloning https://github.com/OpenMined/PySyft (to revision dev) to /tmp/pip-install-tjhwud16/syft_5391efd74ee248e785982ea2e00f5980
Running command git clone --filter=blob:none --quiet https://github.com/OpenMined/PySyft /tmp/pip-install-tjhwud16/syft_5391efd74ee248e785982ea2e00f5980
Resolved https://github.com/OpenMined/PySyft to commit f43cfe6
ERROR: syft from git+https://github.com/OpenMined/PySyft@dev#egg=syft does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found

@VirajGhorpade
Copy link

Below worked for me.
It is about torch and torchvison version compatibility

1. pip install syft
2. pip install torchvision===0.1.6 torchaudio===0.11.0 -f https://download.pytorch.org/whl/torch_stable.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question ❔ Question about implementation or some technical aspect
Projects
None yet
Development

No branches or pull requests

10 participants