pytorch 安装
报错:
OSError: [WinError 126] The specified module could not be found. Error loading "xxx\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.
安装 VC_redist.X64 没用(即Microsoft Visual C++ Redistributable,这是visual c++的一个运行环境,类比java的jre)
安装 Visual Studio 就可以了,https://visualstudio.microsoft.com/zh-hans/vs/features/cplusplus/
后面可能还会报没有 numpy,安装numpy后又报 _ARRAY_API not found 错误,检查一下是不是安装的 numpy 2.x,卸载重装
python -m pip uninstall numpy
# 安装 1.24.0 也会报错
python -m pip install numpy==1.26.4
Tags: