无法用pip安装pycuda
Can't install pycuda with pip
我正在尝试将 PyCUDA 模块安装到 运行 我下载的一些 python 脚本,但是尝试使用 pip 安装它不起作用。
我在命令行运行pip install pycuda
起初,我得到这个:
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
然后出现(全部为红色):
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.
我不知道这个错误是什么,也不知道如何修复它(我不想进行复杂的安装,这会花费我几个小时,甚至可能无法工作)。我什至不确定这个模块的作用(还)。你有什么想法可以帮助我吗?
(编辑:我在 Windows 10,我之前没有安装任何关于 PyCUDA 的东西)
试试下面的方法。
pip install pipwin
pipwin install pycuda
我正在尝试将 PyCUDA 模块安装到 运行 我下载的一些 python 脚本,但是尝试使用 pip 安装它不起作用。
我在命令行运行pip install pycuda
起初,我得到这个:
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
然后出现(全部为红色):
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.
我不知道这个错误是什么,也不知道如何修复它(我不想进行复杂的安装,这会花费我几个小时,甚至可能无法工作)。我什至不确定这个模块的作用(还)。你有什么想法可以帮助我吗?
(编辑:我在 Windows 10,我之前没有安装任何关于 PyCUDA 的东西)
试试下面的方法。
pip install pipwin
pipwin install pycuda