1、pip install mxnet,失败,提示:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
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/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: No metadata found in d:program files (x86)python3.9.4libsite-packages
Rolling back uninstall of numpy
Moving to d:program files (x86)python3.9.4libsite-packagesnumpy-1.22.3.dist-info
from D:Program Files (x86)python3.9.4Libsite-packages~umpy-1.22.3.dist-info
Moving to d:program files (x86)python3.9.4libsite-packagesnumpy
from D:Program Files (x86)python3.9.4Libsite-packages~-mpy
Moving to d:program files (x86)python3.9.4scriptsf2py.exe
from C:UserslilinAppDataLocalTemppip-uninstall-a6sj89baf2py.exe
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> numpy
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
WARNING: Ignoring invalid distribution -ip (d:program files (x86)python3.9.4libsite-packages)
WARNING: Ignoring invalid distribution -ip (d:program files (x86)python3.9.4libsite-packages)
WARNING: Ignoring invalid distribution -ip (d:program files (x86)python3.9.4libsite-packages)
2、尝试
(1)pip uninstall numpy,失败
(2)解决常见pip install错误方法;
https://www.youtube.com/watch?v=YVfvLYM2Yes&ab_channel=MustufaBaighttps://www.youtube.com/watch?v=YVfvLYM2Yes&ab_channel=MustufaBaig(3)采用手动下载mxnet文件,然后加载。
在mxnet文件本地路径下输入cmd,输入"pip install
F:Download>pip install mxnet-1.9.0+mkl-cp39-cp39-win_amd64.whl
文件下载链接:手动搜索mxnet
https://www.lfd.uci.edu/~gohlke/pythonlibs/#basemap
遇到同类问题:
1、python - Gettingerror: legacy-install-failure, while installing basemap - Stack Overflow
2、python - How to resolve the error of legacy-install-failure? - Stack Overflow
其他链接:
mxnet-cu112 · PyPI
----------
安装mxnet后,运行之后再次报错:
FileNotFoundError: Could not find module 'D:Program Files (x86)python3.9.4libsite-packagesmxnetlibmxnet.dll' (or one of its dependencies). Try using the full path with constructor syntax.
暂时未解决,相同问题.
1、https://github.com/apache/incubator-mxnet/issues/17887
------------
附录:
1、
ModuleNotFoundError: No module named 'pip' 解决办法 python -m ensurepip python -m pip install --upgrade pip



