安装cupy [pip install cupy]失败

pip install cupy 失败,出现如下的错误信息:

Collecting cupy
  Using cached https://files.pythonhosted.org/packages/4d/08/2b25443d31ea34cdd259a689d67bc20f19df0c079e1f517ca1bd5bd7e6e2/cupy-6.2.0.tar.gz
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Options: {'package_name': 'cupy', 'long_description': None, 'wheel_libs': [], 'wheel_includes': [], 'no_rpath': False, 'profile': False, 'linetrace': False, 'annotate': False, 'no_cuda': False}

    -------- Configuring Module: cuda --------
    cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
    /tmp/tmpemmkk1to/a.cpp:1:23: fatal error: cublas_v2.h: No such file or directory
    compilation terminated.
    command 'gcc' failed with exit status 1

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

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

    Environment Variables:
      CFLAGS          : (none)
      LDFLAGS         : (none)
      LIBRARY_PATH    : (none)
      CUDA_PATH       : (none)
      NVTOOLSEXT_PATH : (none)
      NVCC            : (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 "/tmp/pip-install-bocabbej/cupy/setup.py", line 120, in <module>
        ext_modules = cupy_setup_build.get_ext_modules()
      File "/tmp/pip-install-bocabbej/cupy/cupy_setup_build.py", line 632, in get_ext_modules
        extensions = make_extensions(arg_options, compiler, use_cython)
      File "/tmp/pip-install-bocabbej/cupy/cupy_setup_build.py", line 387, in make_extensions
        raise Exception('Your CUDA environment is invalid. '
    Exception: Your CUDA environment is invalid. Please check above error log.
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-bocabbej/cupy/

升级setuptools和pip :pip install -U setuptools pip, 好像并不能解决问题。
解决的方法主要在于加上cuda版本号,类似于这样:pip install --pre cupy-cuda90
(这个可能只对cuda9.0好用)

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值