在看《動手學深度學習》時,安裝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成功安裝上了,
新手安裝,不知道為何出錯,由于把所有的步驟都試了,所以沒法控制變數知道到底是哪一步起作用了,記錄一下有個參考,個人推薦先試試降版本,
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/546954.html
標籤:Python
