在Windows 10上使用pip安装cupy时出现问题

2024-06-14 06:06:24 发布

您现在位置:Python中文网/ 问答频道 /正文

我想安装cupy,但出现了此错误。我有MX150图形卡,支持cuda。我已经安装了cuda开发工具包和cuDNN: 这是我的系统规格 i5-8250U 8GB内存 英伟达GeForce MX150

我的python版本是3.7.8

pip install cupy
ERROR: Command errored out with exit status 1:
     command: 'c:\users\micha\appdata\local\programs\python\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\micha\\AppData\\Local\\Temp\\pip-install-yra_27m9\\cupy\\setup.py'"'"'; __file__='"'"'C:\\Users\\micha\\AppData\\Local\\Temp\\pip-install-yra_27m9\\cupy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\micha\AppData\Local\Temp\pip-pip-egg-info-e77cwad4'
         cwd: C:\Users\micha\AppData\Local\Temp\pip-install-yra_27m9\cupy\
    Complete output (48 lines):
    Options: {'package_name': 'cupy', 'long_description': None, 'wheel_libs': [], 'wheel_includes': [], 'no_rpath': False, 'profile': False, 'linetrace': False, 'annotate': False, 'no_cuda': False, 'use_hip': False}
    **************************************************
    *** WARNING: nvcc path != CUDA_PATH
    *** WARNING: nvcc path: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1
    *** WARNING: CUDA_PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin
    **************************************************

    -------- Configuring Module: cuda --------
    Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/

    ************************************************************
    * CuPy Configuration Summary                               *
    ************************************************************

    Build Environment:
      Include directories: []
      Library directories: []
      nvcc command       : (not found)

    Environment Variables:
      CFLAGS          : (none)
      LDFLAGS         : (none)
      LIBRARY_PATH    : (none)
      CUDA_PATH       : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin
      NVTOOLSEXT_PATH : (none)
      NVCC            : (none)
      ROCM_HOME       : (none)

    Modules:
      cuda      : No
        -> Include files not found: ['cublas_v2.h', 'cuda.h', 'cuda_profiler_api.h', 'cuda_runtime.h', 'cufft.h', 'curand.h', 'cusparse.h', 'nvrtc.h']
        -> Check your CFLAGS environment variable.

    ERROR: CUDA could not be found on your system.
    Please refer to the Installation Guide for details:
    https://docs-cupy.chainer.org/en/stable/install.html

    ************************************************************

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\micha\AppData\Local\Temp\pip-install-yra_27m9\cupy\setup.py", line 128, in <module>
        ext_modules = cupy_setup_build.get_ext_modules()
      File "C:\Users\micha\AppData\Local\Temp\pip-install-yra_27m9\cupy\cupy_setup_build.py", line 744, in get_ext_modules
        extensions = make_extensions(arg_options, compiler, use_cython)
      File "C:\Users\micha\AppData\Local\Temp\pip-install-yra_27m9\cupy\cupy_setup_build.py", line 492, in make_extensions
        raise Exception('Your CUDA environment is invalid. '
    Exception: Your CUDA environment is invalid. Please check above error log.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Tags: installpippynonefalselocalsetupusers