《动手学深度学习》安装mxnet出现问题

在看《动手学深度学习》时,安装mxnet(CPU)版时安装失败。

首先是下载时使用国内镜像,可参考Python安装库太慢?配置好这个速度飞起 - 知乎 (zhihu.com)

下载时出现的问题:

Building wheel for numpy (setup.py) ... error          error: subprocess-exited-with-error           python setup.py bdist_wheel did not run successfully.        error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/  ERROR: Failed building wheel for numpy       Running setup.py clean for numpy         error: subprocess-exited-with-error        ERROR: Failed cleaning build dir for numpy           Running setup.py install for numpy did not run successfully.              error: legacy-install-failure         python setup.py bdist_wheel did not run successfully.         python setup.py clean did not run successfully.            Failed cleaning build dir for numpy       error: legacy-install-failure         × Encountered error while trying to install package.     ╰─> numpy

大概就是以上内容(摘抄了一部分)。我的python版本是3.10 , 百度了好半天,有的说要安装setuptools,wheel,还有说需要安装Microsoft Visual C++ 14.0 ,这里有个替代版本(9条消息) Microsoft Visual C++ 14.0 is required._哈哈哈,冲冲冲的博客-CSDN博客。有的说版本不匹配,要降版本。由于我不懂,所以网上的所有办法都试了,各种安装东西,各种更新版本,最后的版本是python3.10,numpy1.22.4(pip install  -U  numpy==1.22.4) , wheel(0.40.0)  , setuptools(67.6.0) ,这里的numpy是百度的与python3.10匹配的,wheel和setuptools是直接更新的(pip install wheel setuptools --upgrade)。所有的都装完,还是没见效,安装1.7.0 post1 的mxnet未果,又开始试降版本,1.5也不行,1.4也不行。最后是1.2.0成功安装上了。

新手安装,不知道为何出错,由于把所有的步骤都试了,所以没法控制变量知道到底是哪一步起作用了,记录一下有个参考。个人推荐先试试降版本。

posted @ 2023-03-15 12:03  我的五姑娘  阅读(670)  评论(0编辑  收藏  举报