一个用户aaa 2024-05-15 17:57 采纳率: 50%
浏览 34

mxnet安装时遇到问题

安装mxnet遇到问题,有什么解决的办法吗


C:\Users\86189>pip install mxnet
Defaulting to user installation because normal site-packages is not writeable
Collecting mxnet
  Using cached mxnet-1.7.0.post2-py2.py3-none-win_amd64.whl.metadata (402 bytes)
Collecting numpy<1.17.0,>=1.8.2 (from mxnet)
  Using cached numpy-1.16.6.zip (5.1 MB)
  Preparing metadata (setup.py) ... done
Collecting requests<2.19.0,>=2.18.4 (from mxnet)
  Using cached requests-2.18.4-py2.py3-none-any.whl.metadata (50 kB)
Collecting graphviz<0.9.0,>=0.8.1 (from mxnet)
  Using cached graphviz-0.8.4-py2.py3-none-any.whl.metadata (6.4 kB)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\86189\appdata\roaming\python\python39\site-packages (from requests<2.19.0,>=2.18.4->mxnet) (2023.11.17)
Collecting chardet<3.1.0,>=3.0.2 (from requests<2.19.0,>=2.18.4->mxnet)
  Using cached chardet-3.0.4-py2.py3-none-any.whl.metadata (3.2 kB)
Collecting idna<2.7,>=2.5 (from requests<2.19.0,>=2.18.4->mxnet)
  Using cached idna-2.6-py2.py3-none-any.whl.metadata (8.9 kB)
Collecting urllib3<1.23,>=1.21.1 (from requests<2.19.0,>=2.18.4->mxnet)
  Using cached urllib3-1.22-py2.py3-none-any.whl.metadata (32 kB)
Using cached mxnet-1.7.0.post2-py2.py3-none-win_amd64.whl (33.1 MB)
Using cached graphviz-0.8.4-py2.py3-none-any.whl (16 kB)
Using cached requests-2.18.4-py2.py3-none-any.whl (88 kB)
Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Using cached idna-2.6-py2.py3-none-any.whl (56 kB)
Using cached urllib3-1.22-py2.py3-none-any.whl (132 kB)
Building wheels for collected packages: numpy
  Building wheel for numpy (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [262 lines of output]
      Running from numpy source directory.
      C:\Users\86189\AppData\Local\Temp\pip-install-54zctage\numpy_88357108668540979554aee7c13ffba9\numpy\distutils\misc_util.py:476: SyntaxWarning: "is" with a literal. Did you mean "=="?
        return is_string(s) and ('*' in s or '?' is s)
      blas_opt_info:
      blas_mkl_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries mkl_rt not found in ['C:\\Program Files\\Python39\\lib', 'C:\\', 'C:\\Program Files\\Python39\\libs']
        NOT AVAILABLE

      blis_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries blis not found in ['C:\\Program Files\\Python39\\lib', 'C:\\', 'C:\\Program Files\\Python39\\libs']
        NOT AVAILABLE

      openblas_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries openblas not found in ['C:\\Program Files\\Python39\\lib', 'C:\\', 'C:\\Program Files\\Python39\\libs']
      get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
      customize GnuFCompiler
      Could not locate executable g77
      Could not locate executable f77
      customize IntelVisualFCompiler
      Could not locate executable ifort
      Could not locate executable ifl
      customize AbsoftFCompiler
      Could not locate executable f90
      customize CompaqVisualFCompiler
      Could not locate executable DF
      customize IntelItaniumVisualFCompiler
      Could not locate executable efl
      customize Gnu95FCompiler
      Could not locate executable gfortran
      Could not locate executable f95
      customize G95FCompiler
      Could not locate executable g95
      customize IntelEM64VisualFCompiler
      customize IntelEM64TFCompiler
      Could not locate executable efort
      Could not locate executable efc
      customize PGroupFlangCompiler
      Could not locate executable flang
      don't know how to compile Fortran code on platform 'nt'
        NOT AVAILABLE

      atlas_3_10_blas_threads_info:
      Setting PTATLAS=ATLAS
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries tatlas not found in ['C:\\Program Files\\Python39\\lib', 'C:\\', 'C:\\Program Files\\Python39\\libs']
        NOT AVAILABLE

      atlas_3_10_blas_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries satlas not found in ['C:\\Program Files\\Python39\\lib', 'C:\\', 'C:\\Program Files\\Python39\\libs']
        NOT AVAILABLE

      atlas_blas_threads_info:
      Setting PTATLAS=ATLAS
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries ptf77blas,ptcblas,atlas not found in ['C:\\Program Files\\Python39\\lib', 'C:\\', 'C:\\Program Files\\Python39\\libs']
        NOT AVAILABLE

      atlas_blas_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries f77blas,cblas,atlas not found in ['C:\\Program Files\\Python39\\lib', 'C:\\', 'C:\\Program Files\\Python39\\libs']
        NOT AVAILABLE

      accelerate_info:
        NOT AVAILABLE

      C:\Users\86189\AppData\Local\Temp\pip-install-54zctage\numpy_88357108668540979554aee7c13ffba9\numpy\distutils\system_info.py:639: UserWarning:
          Atlas (http://math-atlas.sourceforge.net/) libraries not found.
          Directories to search for the libraries can be specified in the
          numpy/distutils/site.cfg file (section [atlas]) or by setting
          the ATLAS environment variable.
        self.calc_info()
      blas_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries blas not found in ['C:\\Program Files\\Python39\\lib', 'C:\\', 'C:\\Program Files\\Python39\\libs']
        NOT AVAILABLE

      C:\Users\86189\AppData\Local\Temp\pip-install-54zctage\numpy_88357108668540979554aee7c13ffba9\numpy\distutils\system_info.py:639: UserWarning:
          Blas (http://www.netlib.org/blas/) libraries not found.
          Directories to search for the libraries can be specified in the
          numpy/distutils/site.cfg file (section [blas]) or by setting
          the BLAS environment variable.
        self.calc_info()
      blas_src_info:
        NOT AVAILABLE

      C:\Users\86189\AppData\Local\Temp\pip-install-54zctage\numpy_88357108668540979554aee7c13ffba9\numpy\distutils\system_info.py:639: UserWarning:
          Blas (http://www.netlib.org/blas/) sources not found.
          Directories to search for the sources can be specified in the
          numpy/distutils/site.cfg file (section [blas_src]) or by setting
          the BLAS_SRC environment variable.
        self.calc_info()
        NOT AVAILABLE

      non-existing path in 'numpy\\distutils': 'site.cfg'
      lapack_opt_info:
      lapack_mkl_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries mkl_rt not found in ['C:\\Program Files\\Python39\\lib', 'C:\\', 'C:\\Program Files\\Python39\\libs']
        NOT AVAILABLE

      openblas_lapack_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries openblas not found in ['C:\\Program Files\\Python39\\lib', 'C:\\', 'C:\\Program Files\\Python39\\libs']
        NOT AVAILABLE

      openblas_clapack_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries openblas,lapack not found in ['C:\\Program Files\\Python39\\lib', 'C:\\', 'C:\\Program Files\\Python39\\libs']
        NOT AVAILABLE

      atlas_3_10_threads_info:
      Setting PTATLAS=ATLAS
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\Program Files\Python39\lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries tatlas,tatlas not found in C:\Program Files\Python39\lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries tatlas,tatlas not found in C:\
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\Program Files\Python39\libs
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries tatlas,tatlas not found in C:\Program Files\Python39\libs
      <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
        NOT AVAILABLE

      atlas_3_10_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\Program Files\Python39\lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries satlas,satlas not found in C:\Program Files\Python39\lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries satlas,satlas not found in C:\
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\Program Files\Python39\libs
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries satlas,satlas not found in C:\Program Files\Python39\libs
      <class 'numpy.distutils.system_info.atlas_3_10_info'>
        NOT AVAILABLE

      atlas_threads_info:
      Setting PTATLAS=ATLAS
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\Program Files\Python39\lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries ptf77blas,ptcblas,atlas not found in C:\Program Files\Python39\lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries ptf77blas,ptcblas,atlas not found in C:\
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\Program Files\Python39\libs
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries ptf77blas,ptcblas,atlas not found in C:\Program Files\Python39\libs
      <class 'numpy.distutils.system_info.atlas_threads_info'>
        NOT AVAILABLE

      atlas_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\Program Files\Python39\lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries f77blas,cblas,atlas not found in C:\Program Files\Python39\lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries f77blas,cblas,atlas not found in C:\
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack_atlas not found in C:\Program Files\Python39\libs
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries f77blas,cblas,atlas not found in C:\Program Files\Python39\libs
      <class 'numpy.distutils.system_info.atlas_info'>
        NOT AVAILABLE

      lapack_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries lapack not found in ['C:\\Program Files\\Python39\\lib', 'C:\\', 'C:\\Program Files\\Python39\\libs']
        NOT AVAILABLE

      C:\Users\86189\AppData\Local\Temp\pip-install-54zctage\numpy_88357108668540979554aee7c13ffba9\numpy\distutils\system_info.py:639: UserWarning:
          Lapack (http://www.netlib.org/lapack/) libraries not found.
          Directories to search for the libraries can be specified in the
          numpy/distutils/site.cfg file (section [lapack]) or by setting
          the LAPACK environment variable.
        self.calc_info()
      lapack_src_info:
        NOT AVAILABLE

      C:\Users\86189\AppData\Local\Temp\pip-install-54zctage\numpy_88357108668540979554aee7c13ffba9\numpy\distutils\system_info.py:639: UserWarning:
          Lapack (http://www.netlib.org/lapack/) sources not found.
          Directories to search for the sources can be specified in the
          numpy/distutils/site.cfg file (section [lapack_src]) or by setting
          the LAPACK_SRC environment variable.
        self.calc_info()
        NOT AVAILABLE

      C:\Program Files\Python39\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
        warnings.warn(msg)
      running bdist_wheel
      running build
      running config_cc
      unifing config_cc, config, build_clib, build_ext, build commands --compiler options
      running config_fc
      unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
      running build_src
      build_src
      building py_modules sources
      creating build
      creating build\src.win-amd64-3.9
      creating build\src.win-amd64-3.9\numpy
      creating build\src.win-amd64-3.9\numpy\distutils
      building library "npymath" sources
      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.
  ERROR: Failed building wheel for numpy
  Running setup.py clean for numpy
  error: subprocess-exited-with-error

  × python setup.py clean did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Running from numpy source directory.

      `setup.py clean` is not supported, use one of the following instead:

        - `git clean -xdf` (cleans all files)
        - `git clean -Xdf` (cleans all versioned files, doesn't touch
                            files that aren't checked into the git repo)

      Add `--force` to your command to use it anyway if you must (unsupported).

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed cleaning build dir for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
  • 写回答

2条回答 默认 最新

  • 阿里嘎多学长 2024-05-15 17:57
    关注

    以下内容由CHATGPT及阿里嘎多学长共同生成、有用望采纳:


    您想要解决的问题

    您提问的目的是解决在安装MXNet时遇到的依赖问题,尤其是与NumPy相关的编译错误。

    问题出现原因

    问题出现的原因是在安装MXNet的过程中,NumPy的编译失败。错误信息表明,编译过程需要Microsoft Visual C++ 14.0或更高版本,这通常与Python开发环境的配置有关。此外,错误信息还指出了多个库(如MKL、BLIS、OpenBLAS等)未能找到,这可能是因为这些库没有正确安装或配置在系统路径中。

    问题解决方案

    1. 安装Microsoft Visual C++ Build Tools:确保您的系统中安装了Microsoft Visual C++编译器。您可以从以下链接下载并安装所需的编译器工具: Microsoft C++ Build Tools

    2. 安装NumPy:在安装了Visual C++ Build Tools之后,尝试单独安装NumPy,以确保它是可用的:

      pip install numpy
      
    3. 使用预编译的NumPy轮:如果编译NumPy仍然存在问题,您可以尝试使用已经预编译好的轮(wheel)来安装:

      pip install numpy --no-binary :all:
      
    4. 安装MXNet:在成功安装NumPy之后,再次尝试安装MXNet:

      pip install mxnet
      
    5. 设置环境变量:如果问题依旧,您可能需要设置环境变量,指向您的BLAS和LAPACK库。这通常涉及到找到这些库的安装位置,并在系统的环境变量中添加它们。

    提供代码

    由于这个问题主要是关于环境配置和依赖安装的,没有特定的代码需要提供。上述命令应该在命令行中运行。

    代码运行方式

    您需要在具有管理员权限的命令行环境中运行上述命令。

    代码预期运行结果

    如果一切顺利,您应该能够看到NumPy和MXNet成功安装的消息,而不会出现任何错误。

    推荐相关链接

    请按照上述步骤操作,如果问题依旧存在,可能需要进一步的系统环境检查或配置。

    评论 编辑记录

报告相同问题?

问题事件

  • 创建了问题 5月15日

悬赏问题

  • ¥15 Opencv配置出错
  • ¥15 模电中二极管,三极管和电容的应用
  • ¥15 关于模型导入UNITY的.FBX: Check external application preferences.警告。
  • ¥15 气象网格数据与卫星轨道数据如何匹配
  • ¥100 java ee ssm项目 悬赏,感兴趣直接联系我
  • ¥15 微软账户问题不小心注销了好像
  • ¥15 x264库中预测模式字IPM、运动向量差MVD、量化后的DCT系数的位置
  • ¥15 curl 命令调用正常,程序调用报 java.net.ConnectException: connection refused
  • ¥20 关于web前端如何播放二次加密m3u8视频的问题
  • ¥15 使用百度地图api 位置函数报错?