importterror:在vscode中导入syft时导入lib时DLL加载失败



我用conda和python 3.9.7创建了一个新的环境(my_syft env),并安装了syft 0.5.0。

然后我检查我的模块的安装,似乎安装通过正确

C:Userstamir>conda activate my_syft_env

(my_syft_env) C:Userstamir>python
Python 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import syft
>>>
>>> import sys
>>> print(sys.executable)
C:Userstamiranaconda3envsmy_syft_envpython.exe
>>> 

然后尝试在VScode中运行并检查我的模块,并选择当前环境C:Userstamiranaconda3envsmy_syft_envpython.exe

import syft
print("hellow")

but get en error

Traceback (most recent call last):
File "c:UserstamirDesktopTAMIRpyton vscodefederated.py", line 1, in <module>
import syft
File "C:Userstamiranaconda3libsite-packagessyft__init__.py", line 48, in <module>
from syft.core.node.device.device import Device  # noqa: F401
File "C:Userstamiranaconda3libsite-packagessyftcorenodedevice__init__.py", line 2, in <module>
from .client import DeviceClient
File "C:Userstamiranaconda3libsite-packagessyftcorenodedeviceclient.py", line 16, in <module>
from ..common.client import Client
File "C:Userstamiranaconda3libsite-packagessyftcorenodecommonclient.py", line 18, in <module>
from ....lib import create_lib_ast
File "C:Userstamiranaconda3libsite-packagessyftlib__init__.py", line 28, in <module>
from ..lib.torch import create_torch_ast
File "C:Userstamiranaconda3libsite-packagessyftlibtorch__init__.py", line 12, in <module>
from . import parameter  # noqa: 401
File "C:Userstamiranaconda3libsite-packagessyftlibtorchparameter.py", line 9, in <module>
from ...lib.torch.tensor_util import tensor_deserializer
File "C:Userstamiranaconda3libsite-packagessyftlibtorchtensor_util.py", line 2, in <module>
import pyarrow as pa
File "C:Userstamiranaconda3libsite-packagespyarrow__init__.py", line 63, in <module>
import pyarrow.lib as _lib
ImportError: DLL load failed while importing lib: The specified procedure could not be found.

我不知道为什么有错误。

我可能来晚了,但是为了解释这个线程,您可能已经从默认的conda通道安装了libboostboost-cpp。试试以下命令:

  • conda install libboost boost-cpp -c conda-forge
  • 如果在Windows机器上,确保你有Visual c++ Redistributables 2019或更高版本。
  • 查看pyarrow的pip版本是否有效。

我在使用python 3.10的windows上遇到了同样的问题,我的解决方法如下:

  1. 升级皮普:

python -m pip install——upgrade pip

  1. install/upgradepyarrow:

pip install——upgrade pyarrow

相关内容

  • 没有找到相关文章

最新更新