windows 8.1 中 python 的 MXNet 安装失败,platform.architecture == ('WindowsPE','64bit')

MXNet installation fails on python in windows 8.1 with platform.architecture == ('WindowsPE','64bit')

在 python3 上,错误堆栈是:

>>> import mxnet
Traceback (most recent call last):
    File "", line 1, in 
    File "C:\Python36\lib\site-packages\mxnet\__init__.py", line 24, in 
        from .context import Context, current_context, cpu, gpu, cpu_pinned
    File "C:\Python36\lib\site-packages\mxnet\context.py", line 24, in 
        from .base import classproperty, with_metaclass, _MXClassPropertyMetaClass
    File "C:\Python36\lib\site-packages\mxnet\base.py", line 214, in 
        _LIB = _load_lib()
    File "C:\Python36\lib\site-packages\mxnet\base.py", line 205, in _load_lib
        lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_LOCAL)
    File "C:\Python36\lib\ctypes\__init__.py", line 344, in __init__
        self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

解决方案:

  1. 卸载 MXNet:
    pip uninstall mxnet
    (或您安装的版本)
  2. 下载适用于 Visual Studio 2015 的 Visual C++ Redistributable:https://www.microsoft.com/en-us/download/details.aspx?id=48145
  3. 重新安装:
    pip install mxnet
    (或您想要的版本)