安装python模块在Windows 8.1 x64上使用gpu

时间:2013-12-31 11:37:14

标签: python boost cuda gpu pycuda

我在安装python模块时遇到了一些麻烦 我想在python脚本中使用gpu但是在安装模块时出现了一些错误 1-我安装了我的图形驱动程序:Geforce GT 650M
2-安装cuda_5.5.31_winvista_win7_win8_win8.1_notebook_x64.exe
现在我想安装模块,这些都是错误:

Pyrit错误:

C:\Users\Ali\Desktop\pygpu\pyrit-0.4.0>python setup.py build
running build
running build_py
running build_ext
building 'cpyrit._cpyrit_cpu' extension
error: Unable to find vcvarsall.bat

C:\Users\Ali\Desktop\pygpu\pyrit-0.4.0>python setup.py install
running install
running build
running build_py
running build_ext
building 'cpyrit._cpyrit_cpu' extension
error: Unable to find vcvarsall.bat

C:\Users\Ali\Desktop\pygpu\pyrit-0.4.0>

cpyrit-cuda错误:

C:\Users\Ali\Desktop\pygpu\cpyrit-cuda-0.4.0>python setup.py build
The CUDA compiler and headers required to build kernel were not found. Trying to
 continue anyway...
running build
running build_ext
'nvcc' is not recognized as an internal or external command,
operable program or batch file.
None
Failed to execute command 'nvcc -V'
Traceback (most recent call last):
  File "setup.py", line 175, in <module>
    setup(**setup_args)
  File "C:\Python27\lib\distutils\core.py", line 152, in setup
    dist.run_commands()
  File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python27\lib\distutils\command\build.py", line 127, in run
    self.run_command(cmd_name)
  File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 82, in run
    raise SystemError("Nvidia's CUDA-compiler 'nvcc' can't be " \
SystemError: Nvidia's CUDA-compiler 'nvcc' can't be found.

C:\Users\Ali\Desktop\pygpu\cpyrit-cuda-0.4.0>python setup.py install
The CUDA compiler and headers required to build kernel were not found. Trying to
 continue anyway...
running install
running build
running build_ext
'nvcc' is not recognized as an internal or external command,
operable program or batch file.
None
Failed to execute command 'nvcc -V'
Traceback (most recent call last):
  File "setup.py", line 175, in <module>
    setup(**setup_args)
  File "C:\Python27\lib\distutils\core.py", line 152, in setup
    dist.run_commands()
  File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python27\lib\distutils\command\install.py", line 563, in run
    self.run_command('build')
  File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python27\lib\distutils\command\build.py", line 127, in run
    self.run_command(cmd_name)
  File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 82, in run
    raise SystemError("Nvidia's CUDA-compiler 'nvcc' can't be " \
SystemError: Nvidia's CUDA-compiler 'nvcc' can't be found.

C:\Users\Ali\Desktop\pygpu\cpyrit-cuda-0.4.0>

pycuda错误:

C:\Users\Ali\Desktop\pygpu\pycuda-2013.1.1>python setup.py build
*** WARNING: nvcc not in path.
Traceback (most recent call last):
  File "setup.py", line 218, in <module>
    main()
  File "setup.py", line 88, in main
    conf["CUDA_INC_DIR"] = [join(conf["CUDA_ROOT"], "include")]
  File "C:\Python27\lib\ntpath.py", line 96, in join
    assert len(path) > 0
TypeError: object of type 'NoneType' has no len()

C:\Users\Ali\Desktop\pygpu\pycuda-2013.1.1>python setup.py install
*** WARNING: nvcc not in path.
Traceback (most recent call last):
  File "setup.py", line 218, in <module>
    main()
  File "setup.py", line 88, in main
    conf["CUDA_INC_DIR"] = [join(conf["CUDA_ROOT"], "include")]
  File "C:\Python27\lib\ntpath.py", line 96, in join
    assert len(path) > 0
TypeError: object of type 'NoneType' has no len()

C:\Users\Ali\Desktop\pygpu\pycuda-2013.1.1>

numpy错误:

C:\Users\Ali\Desktop\pygpu\numpy-1.8.0>python setup.py build
Running from numpy source directory.
non-existing path in 'numpy\\distutils': 'site.cfg'
F2PY Version 2
blas_opt_info:
blas_mkl_info:
  libraries mkl,vml,guide not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python
27\\libs']
  NOT AVAILABLE

openblas_info:
  libraries openblas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\l
ibs']
  NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
  libraries ptf77blas,ptcblas,atlas not found in ['C:\\Python27\\lib', 'C:\\', '
C:\\Python27\\libs']
  NOT AVAILABLE

atlas_blas_info:
  libraries f77blas,cblas,atlas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\
Python27\\libs']
  NOT AVAILABLE

C:\Users\Ali\Desktop\pygpu\numpy-1.8.0\numpy\distutils\system_info.py:1522: User
Warning:
    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.
  warnings.warn(AtlasNotFoundError.__doc__)
blas_info:
  libraries blas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs'
]
  NOT AVAILABLE

C:\Users\Ali\Desktop\pygpu\numpy-1.8.0\numpy\distutils\system_info.py:1531: User
Warning:
    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.
  warnings.warn(BlasNotFoundError.__doc__)
blas_src_info:
  NOT AVAILABLE

C:\Users\Ali\Desktop\pygpu\numpy-1.8.0\numpy\distutils\system_info.py:1534: User
Warning:
    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.
  warnings.warn(BlasSrcNotFoundError.__doc__)
  NOT AVAILABLE

non-existing path in 'numpy\\lib': 'benchmarks'
lapack_opt_info:
lapack_mkl_info:
mkl_info:
  libraries mkl,vml,guide not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python
27\\libs']
  NOT AVAILABLE

  NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
  libraries ptf77blas,ptcblas,atlas not found in C:\Python27\lib
  libraries lapack_atlas not found in C:\Python27\lib
  libraries ptf77blas,ptcblas,atlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries ptf77blas,ptcblas,atlas not found in C:\Python27\libs
  libraries lapack_atlas not found in C:\Python27\libs
numpy.distutils.system_info.atlas_threads_info
  NOT AVAILABLE

atlas_info:
  libraries f77blas,cblas,atlas not found in C:\Python27\lib
  libraries lapack_atlas not found in C:\Python27\lib
  libraries f77blas,cblas,atlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries f77blas,cblas,atlas not found in C:\Python27\libs
  libraries lapack_atlas not found in C:\Python27\libs
numpy.distutils.system_info.atlas_info
  NOT AVAILABLE

C:\Users\Ali\Desktop\pygpu\numpy-1.8.0\numpy\distutils\system_info.py:1428: User
Warning:
    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.
  warnings.warn(AtlasNotFoundError.__doc__)
lapack_info:
  libraries lapack not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\lib
s']
  NOT AVAILABLE

C:\Users\Ali\Desktop\pygpu\numpy-1.8.0\numpy\distutils\system_info.py:1439: User
Warning:
    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.
  warnings.warn(LapackNotFoundError.__doc__)
lapack_src_info:
  NOT AVAILABLE

C:\Users\Ali\Desktop\pygpu\numpy-1.8.0\numpy\distutils\system_info.py:1442: User
Warning:
    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.
  warnings.warn(LapackSrcNotFoundError.__doc__)
  NOT AVAILABLE

C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option:
 'define_macros'
  warnings.warn(msg)
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler opti
ons
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler opt
ions
running build_src
build_src
building py_modules sources
creating build
creating build\src.win-amd64-2.7
creating build\src.win-amd64-2.7\numpy
creating build\src.win-amd64-2.7\numpy\distutils
building library "npymath" sources
No module named msvccompiler in numpy.distutils; trying from distutils
error: Unable to find vcvarsall.bat

C:\Users\Ali\Desktop\pygpu\numpy-1.8.0>python setup.py install
Running from numpy source directory.
non-existing path in 'numpy\\distutils': 'site.cfg'
F2PY Version 2
blas_opt_info:
blas_mkl_info:
  libraries mkl,vml,guide not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python
27\\libs']
  NOT AVAILABLE

openblas_info:
  libraries openblas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\l
ibs']
  NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
  libraries ptf77blas,ptcblas,atlas not found in ['C:\\Python27\\lib', 'C:\\', '
C:\\Python27\\libs']
  NOT AVAILABLE

atlas_blas_info:
  libraries f77blas,cblas,atlas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\
Python27\\libs']
  NOT AVAILABLE

C:\Users\Ali\Desktop\pygpu\numpy-1.8.0\numpy\distutils\system_info.py:1522: User
Warning:
    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.
  warnings.warn(AtlasNotFoundError.__doc__)
blas_info:
  libraries blas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\libs'
]
  NOT AVAILABLE

C:\Users\Ali\Desktop\pygpu\numpy-1.8.0\numpy\distutils\system_info.py:1531: User
Warning:
    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.
  warnings.warn(BlasNotFoundError.__doc__)
blas_src_info:
  NOT AVAILABLE

C:\Users\Ali\Desktop\pygpu\numpy-1.8.0\numpy\distutils\system_info.py:1534: User
Warning:
    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.
  warnings.warn(BlasSrcNotFoundError.__doc__)
  NOT AVAILABLE

non-existing path in 'numpy\\lib': 'benchmarks'
lapack_opt_info:
lapack_mkl_info:
mkl_info:
  libraries mkl,vml,guide not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python
27\\libs']
  NOT AVAILABLE

  NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
  libraries ptf77blas,ptcblas,atlas not found in C:\Python27\lib
  libraries lapack_atlas not found in C:\Python27\lib
  libraries ptf77blas,ptcblas,atlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries ptf77blas,ptcblas,atlas not found in C:\Python27\libs
  libraries lapack_atlas not found in C:\Python27\libs
numpy.distutils.system_info.atlas_threads_info
  NOT AVAILABLE

atlas_info:
  libraries f77blas,cblas,atlas not found in C:\Python27\lib
  libraries lapack_atlas not found in C:\Python27\lib
  libraries f77blas,cblas,atlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries f77blas,cblas,atlas not found in C:\Python27\libs
  libraries lapack_atlas not found in C:\Python27\libs
numpy.distutils.system_info.atlas_info
  NOT AVAILABLE

C:\Users\Ali\Desktop\pygpu\numpy-1.8.0\numpy\distutils\system_info.py:1428: User
Warning:
    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.
  warnings.warn(AtlasNotFoundError.__doc__)
lapack_info:
  libraries lapack not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\lib
s']
  NOT AVAILABLE

C:\Users\Ali\Desktop\pygpu\numpy-1.8.0\numpy\distutils\system_info.py:1439: User
Warning:
    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.
  warnings.warn(LapackNotFoundError.__doc__)
lapack_src_info:
  NOT AVAILABLE

C:\Users\Ali\Desktop\pygpu\numpy-1.8.0\numpy\distutils\system_info.py:1442: User
Warning:
    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.
  warnings.warn(LapackSrcNotFoundError.__doc__)
  NOT AVAILABLE

C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option:
 'define_macros'
  warnings.warn(msg)
running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler opti
ons
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler opt
ions
running build_src
build_src
building py_modules sources
building library "npymath" sources
No module named msvccompiler in numpy.distutils; trying from distutils
error: Unable to find vcvarsall.bat

C:\Users\Ali\Desktop\pygpu\numpy-1.8.0>

提升错误:

C:\Users\Ali\Desktop\pygpu\boost_1_55_0>bootstrap.bat
Building Boost.Build engine
'cl' is not recognized as an internal or external command,
operable program or batch file.

Failed to build Boost.Build engine.
Please consult bootstrap.log for furter diagnostics.

You can try to obtain a prebuilt binary from

   http://sf.net/project/showfiles.php?group_id=7586&package_id=72941

Also, you can file an issue at http://svn.boost.org
Please attach bootstrap.log in that case.

C:\Users\Ali\Desktop\pygpu\boost_1_55_0>

有人告诉我如何安装nvcc,以及我可以下载的地方。

1 个答案:

答案 0 :(得分:1)

你在这里遗漏了几件事。

  1. 解释了vcvarsall错误here,您必须设置变量。
  2. 然后您遗漏了nvcc所述的WARNING: nvcc not in path.和类似消息。
  3. numpy缺少您应首先安装的依赖库。
  4. 对于boost,您应该遵循该建议并使用预先构建的二进制文件。
  5. 总而言之,我要说的是阅读和理解错误信息。建议:按照库网站上的安装指南进行操作,这些指南也会显示依赖关系。