开发环境:
Windows:10 64位
Python:3.8
Anaconda:3
作者在安装MindSpore平台的过程中,最先遇到的问题是:
在cmd终端中,执行
python -c "import mindspore;mindspore.run_check()"
“Original error was: DLL load failed while importing _multiarray_umath: 找不到指定的模块。”
解决方案:
第一步:在终端中执行
#卸载numpy
pip uninstall numpy
若电脑中安装了anaconda3,则建议再次执行
#卸载numpy
conda uninstall numpy
卸载成功后,终端会给出类似“uninstall successfully”的信息。
第二步:根据开发环境,下载对应的numpy的轮子文件,网址如下:
按照作者的开发环境,下载的是:numpy-1.23.2-cp38-cp38-win_amd64.whl 文件,保存到了C:\Users\1234\Downloads\目录下,
其中:
1.23.2是numpy的版本号,
cp38中的38为python的版本号“3.8”,
win_amd64为64位windows操作系统
第三步:下载成功后,安装numpy,在终端执行
pip install C:\Users\1234\Downloads\numpy-1.23.2-cp38-cp38-win_amd64.whl
第四步:打开 Anaconda Powershell Prompt终端,再次执行
python -c "import mindspore;mindspore.run_check()"
遇到第二个问题:
“ImportError: cannot import name 'truncnorm' from 'scipy.stats' (unknown location)”
第五步:卸载原有的scipy
#卸载scipy
pip uninstall scipy
若电脑中安装了anaconda3,则建议再次执行
#卸载scipy
conda uninstall scipy
卸载成功后,终端会给出类似“uninstall successfully”的信息。
第六步:根据开发环境,下载对应的scipy的轮子文件,网址如下:
按照作者的开发环境,下载的是:scipy-1.9.1-cp38-cp38-win_amd64.whl 文件,保存到了C:\Users\1234\Downloads\目录下,
第七步:下载成功后,安装scipy,在终端执行
pip install C:\Users\1234\Downloads\scipy-1.9.1-cp38-cp38-win_amd64.whl
第八步:打开 Anaconda Powershell Prompt终端,再次执行
python -c "import mindspore;mindspore.run_check()"
安装MindSpore平台成功!输出:
(base) PS C:\Users\1234> python -c "import mindspore;mindspore.run_check()"
MindSpore version: 1.8.1
The result of multiplication calculation is correct, MindSpore has been installed successfully!