Pip 安装后导入syft会导致火炬错误

Pip 安装后导入syft会导致火炬错误,pip,torch,modulenotfounderror,pysyft,Pip,Torch,Modulenotfounderror,Pysyft,我已经使用下面的命令在Windows10上创建的虚拟环境中安装了syft python -m venv demo 在此之后,我激活了虚拟环境,打开了jupyter笔记本,并尝试通过它安装最新版本的syft !pip install syft 安装成功,没有任何错误。 但是,当我尝试导入相同的内容时,会出现“torch”错误 import syft as sy ModuleNotFoundError Traceback (most recent c

我已经使用下面的命令在Windows10上创建的虚拟环境中安装了syft

python -m venv demo
在此之后,我激活了虚拟环境,打开了jupyter笔记本,并尝试通过它安装最新版本的syft

!pip install syft
安装成功,没有任何错误。 但是,当我尝试导入相同的内容时,会出现“torch”错误

import syft as sy

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-281ee5c8ca5f> in <module>
----> 1 import syft as sy

~\AppData\Roaming\Python\Python37\site-packages\syft\__init__.py in <module>
     12 # This import statement is strictly here to trigger registration of syft
     13 # tensor types inside hook_args.py.
---> 14 import syft.frameworks.torch.hook.hook_args
     15 
     16 import logging

~\AppData\Roaming\Python\Python37\site-packages\syft\frameworks\torch\hook\hook_args.py in <module>
----> 1 import torch
      2 
      3 from syft import dependency_check
      4 from syft.frameworks.torch.tensors.interpreters.native import TorchTensor
      5 from syft.generic.frameworks.hook.hook_args import (

ModuleNotFoundError: No module named 'torch'
将syft导入为sy
ModuleNotFoundError回溯(上次最近调用)
在里面
---->1作为sy导入syft
~\AppData\Roaming\Python\Python37\site packages\syft\\uuuuu init\uuuuuuuu.py in
12#本进口声明严格用于触发syft注册
13#hook_args.py内的张量类型。
--->14导入syft.frameworks.torch.hook.hook_args
15
16导入日志
中的~\AppData\Roaming\Python\Python37\site packages\syft\frameworks\torch\hook\hook\u args.py
---->1个进口火炬
2.
3来自syft导入依赖项检查
4来自syft.frameworks.torch.tensors.translators.native import TorchTensor
5来自syft.generic.frameworks.hook.hook_args导入(
ModuleNotFoundError:没有名为“torch”的模块
环境详情

  • python:3.7
  • Syft:0.3.0