首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法使用pip安装pycuda

无法使用pip安装pycuda
EN

Stack Overflow用户
提问于 2020-10-10 03:24:13
回答 1查看 4K关注 0票数 1

我正在尝试安装PyCUDA模块来运行我下载的一些python脚本,但是尝试使用pip安装它不起作用。

我在命令行上运行pip install pycuda

首先,我得到了这个:

代码语言:javascript
运行
复制
Collecting pycuda
    Using cached pycuda-2020.1.tar.gz (1.6 MB)
Requirement already satisfied: pytools>=2011.2 in c:\users\jules\appdata\local\programs\python\python36-32\lib\site-packages (from pycuda) (2020.4)
Requirement already satisfied: decorator>=3.2.0 in c:\users\jules\appdata\local\programs\python\python36-32\lib\site-packages (from pycuda) (4.4.2)
Requirement already satisfied: appdirs>=1.4.0 in c:\users\jules\appdata\local\programs\python\python36-32\lib\site-packages (from pycuda) (1.4.4)
Requirement already satisfied: mako in c:\users\jules\appdata\local\programs\python\python36-32\lib\site-packages (from pycuda) (1.1.3)
Requirement already satisfied: six>=1.8.0 in c:\users\jules\appdata\local\programs\python\python36-32\lib\site-packages (from pytools>=2011.2->pycuda) (1.11.0)
Requirement already satisfied: numpy>=1.6.0 in c:\users\jules\appdata\local\programs\python\python36-32\lib\site-packages (from pytools>=2011.2->pycuda) (1.14.1)
Requirement already satisfied: MarkupSafe>=0.9.2 in c:\users\jules\appdata\local\programs\python\python36-32\lib\site-packages (from mako->pycuda) (1.1.1)
Using legacy 'setup.py install' for pycuda, since package 'wheel' is not installed.
Installing collected packages: pycuda
    Running setup.py install for pycuda ... error

然后,出现以下内容(全部显示为红色):

代码语言:javascript
运行
复制
ERROR: Command errored out with exit status 1:
     command: 'c:\users\jules\appdata\local\programs\python\python36-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Jules\\AppData\\Local\\Temp\\pip-install-rehu_ea2\\pycuda\\setup.py'"'"'; __file__='"'"'C:\\Users\\Jules\\AppData\\Local\\Temp\\pip-install-rehu_ea2\\pycuda\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Jules\AppData\Local\Temp\pip-record-vlpoymu1\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\jules\appdata\local\programs\python\python36-32\Include\pycuda'
         cwd: C:\Users\Jules\AppData\Local\Temp\pip-install-rehu_ea2\pycuda\
    Complete output (82 lines):
    ***************************************************************
    *** WARNING: nvcc not in path.
    *** May need to set CUDA_INC_DIR for installation to succeed.
    ***************************************************************
    *************************************************************
    *** I have detected that you have not run configure.py.
    *************************************************************
    *** Additionally, no global config files were found.
    *** I will go ahead with the default configuration.
    *** In all likelihood, this will not work out.
    ***
    *** See README_SETUP.txt for more information.
    ***
    *** If the build does fail, just re-run configure.py with the
    *** correct arguments, and then retry. Good luck!
    *************************************************************
    *** HIT Ctrl-C NOW IF THIS IS NOT WHAT YOU WANT
    *************************************************************
    Continuing in 1 seconds...
    c:\users\jules\appdata\local\programs\python\python36-32\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'test_requires'
      warnings.warn(msg)
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.6
    creating build\lib.win32-3.6\pycuda
    copying pycuda\autoinit.py -> build\lib.win32-3.6\pycuda
    copying pycuda\characterize.py -> build\lib.win32-3.6\pycuda
    copying pycuda\compiler.py -> build\lib.win32-3.6\pycuda
    copying pycuda\cumath.py -> build\lib.win32-3.6\pycuda
    copying pycuda\curandom.py -> build\lib.win32-3.6\pycuda
    copying pycuda\debug.py -> build\lib.win32-3.6\pycuda
    copying pycuda\driver.py -> build\lib.win32-3.6\pycuda
    copying pycuda\elementwise.py -> build\lib.win32-3.6\pycuda
    copying pycuda\gpuarray.py -> build\lib.win32-3.6\pycuda
    copying pycuda\reduction.py -> build\lib.win32-3.6\pycuda
    copying pycuda\scan.py -> build\lib.win32-3.6\pycuda
    copying pycuda\tools.py -> build\lib.win32-3.6\pycuda
    copying pycuda\_cluda.py -> build\lib.win32-3.6\pycuda
    copying pycuda\_mymako.py -> build\lib.win32-3.6\pycuda
    copying pycuda\__init__.py -> build\lib.win32-3.6\pycuda
    creating build\lib.win32-3.6\pycuda\gl
    copying pycuda\gl\autoinit.py -> build\lib.win32-3.6\pycuda\gl
    copying pycuda\gl\__init__.py -> build\lib.win32-3.6\pycuda\gl
    creating build\lib.win32-3.6\pycuda\sparse
    copying pycuda\sparse\cg.py -> build\lib.win32-3.6\pycuda\sparse
    copying pycuda\sparse\coordinate.py -> build\lib.win32-3.6\pycuda\sparse
    copying pycuda\sparse\inner.py -> build\lib.win32-3.6\pycuda\sparse
    copying pycuda\sparse\operator.py -> build\lib.win32-3.6\pycuda\sparse
    copying pycuda\sparse\packeted.py -> build\lib.win32-3.6\pycuda\sparse
    copying pycuda\sparse\pkt_build.py -> build\lib.win32-3.6\pycuda\sparse
    copying pycuda\sparse\__init__.py -> build\lib.win32-3.6\pycuda\sparse
    creating build\lib.win32-3.6\pycuda\compyte
    copying pycuda\compyte\array.py -> build\lib.win32-3.6\pycuda\compyte
    copying pycuda\compyte\dtypes.py -> build\lib.win32-3.6\pycuda\compyte
    copying pycuda\compyte\__init__.py -> build\lib.win32-3.6\pycuda\compyte
    running egg_info
    writing pycuda.egg-info\PKG-INFO
    writing dependency_links to pycuda.egg-info\dependency_links.txt
    writing requirements to pycuda.egg-info\requires.txt
    writing top-level names to pycuda.egg-info\top_level.txt
    reading manifest file 'pycuda.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching 'doc\source\_static\*.css'
    warning: no files found matching 'doc\source\_templates\*.html'
    warning: no files found matching '*.cpp' under directory 'bpl-subset\bpl_subset\boost'
    warning: no files found matching '*.html' under directory 'bpl-subset\bpl_subset\boost'
    warning: no files found matching '*.inl' under directory 'bpl-subset\bpl_subset\boost'
    warning: no files found matching '*.txt' under directory 'bpl-subset\bpl_subset\boost'
    warning: no files found matching '*.h' under directory 'bpl-subset\bpl_subset\libs'
    warning: no files found matching '*.ipp' under directory 'bpl-subset\bpl_subset\libs'
    warning: no files found matching '*.pl' under directory 'bpl-subset\bpl_subset\libs'
    writing manifest file 'pycuda.egg-info\SOURCES.txt'
    creating build\lib.win32-3.6\pycuda\cuda
    copying pycuda\cuda\pycuda-complex-impl.hpp -> build\lib.win32-3.6\pycuda\cuda
    copying pycuda\cuda\pycuda-complex.hpp -> build\lib.win32-3.6\pycuda\cuda
    copying pycuda\cuda\pycuda-helpers.hpp -> build\lib.win32-3.6\pycuda\cuda
    copying pycuda\sparse\pkt_build_cython.pyx -> build\lib.win32-3.6\pycuda\sparse
    running build_ext
    building '_driver' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\jules\appdata\local\programs\python\python36-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Jules\\AppData\\Local\\Temp\\pip-install-rehu_ea2\\pycuda\\setup.py'"'"'; __file__='"'"'C:\\Users\\Jules\\AppData\\Local\\Temp\\pip-install-rehu_ea2\\pycuda\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Jules\AppData\Local\Temp\pip-record-vlpoymu1\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\jules\appdata\local\programs\python\python36-32\Include\pycuda' Check the logs for full command output.

我不知道这个错误是关于什么,也不知道如何修复它(我也不想进入复杂的安装,这将花费我几个小时,甚至可能无法工作)。我甚至还不确定这个模块是做什么的。你有什么办法帮我吗?

(编辑:我使用的是Windows10,之前我还没有安装过任何关于PyCUDA的东西)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-10-12 16:14:59

尝试以下操作。

代码语言:javascript
运行
复制
pip install pipwin
pipwin install pycuda
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64286145

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档