我正在尝试安装PyOpenCL并得到此错误。我已经尝试将.whl文件直接安装到site packages文件夹中,并运行gputools,但也不起作用。任何帮助都将非常感激。下面是完整的错误代码。
ERROR: Command errored out with exit status 1:
command: 'c:usersUserNameanaconda3python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\UserName\AppData\Local\Temp\pip-install-uotqx7js\pyopencl_da23417ff44f4dcf9ac1442acec7e11b\setup.py'"'"'; __file__='"'"'C:\Users\UserName\AppData\Local\Temp\pip-install-uotqx7js\pyopencl_da23417ff44f4dcf9ac1442acec7e11b\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersUserNameAppDataLocalTemppip-record-7cpcxmrkinstall-record.txt' --single-version-externally-managed --compile --install-headers 'c:usersUserNameanaconda3Includepyopencl'
cwd: C:UsersUserNameAppDataLocalTemppip-install-uotqx7jspyopencl_da23417ff44f4dcf9ac1442acec7e11b
Complete output (72 lines):
running install
running build
running build_py
creating build
creating buildlib.win-amd64-3.8
creating buildlib.win-amd64-3.8pyopencl
copying pyopenclalgorithm.py -> buildlib.win-amd64-3.8pyopencl
copying pyopenclarray.py -> buildlib.win-amd64-3.8pyopencl
copying pyopenclbitonic_sort.py -> buildlib.win-amd64-3.8pyopencl
copying pyopenclbitonic_sort_templates.py -> buildlib.win-amd64-3.8pyopencl
copying pyopenclcache.py -> buildlib.win-amd64-3.8pyopencl
copying pyopenclcapture_call.py -> buildlib.win-amd64-3.8pyopencl
copying pyopenclclmath.py -> buildlib.win-amd64-3.8pyopencl
copying pyopenclclrandom.py -> buildlib.win-amd64-3.8pyopencl
copying pyopenclcltypes.py -> buildlib.win-amd64-3.8pyopencl
copying pyopenclelementwise.py -> buildlib.win-amd64-3.8pyopencl
copying pyopenclinvoker.py -> buildlib.win-amd64-3.8pyopencl
copying pyopenclipython_ext.py -> buildlib.win-amd64-3.8pyopencl
copying pyopenclreduction.py -> buildlib.win-amd64-3.8pyopencl
copying pyopenclscan.py -> buildlib.win-amd64-3.8pyopencl
copying pyopencltools.py -> buildlib.win-amd64-3.8pyopencl
copying pyopenclversion.py -> buildlib.win-amd64-3.8pyopencl
copying pyopencl_cluda.py -> buildlib.win-amd64-3.8pyopencl
copying pyopencl_mymako.py -> buildlib.win-amd64-3.8pyopencl
copying pyopencl__init__.py -> buildlib.win-amd64-3.8pyopencl
creating buildlib.win-amd64-3.8pyopenclcharacterize
copying pyopenclcharacterizeperformance.py -> buildlib.win-amd64-3.8pyopenclcharacterize
copying pyopenclcharacterize__init__.py -> buildlib.win-amd64-3.8pyopenclcharacterize
creating buildlib.win-amd64-3.8pyopenclcompyte
copying pyopenclcompytearray.py -> buildlib.win-amd64-3.8pyopenclcompyte
copying pyopenclcompytedtypes.py -> buildlib.win-amd64-3.8pyopenclcompyte
copying pyopenclcompyte__init__.py -> buildlib.win-amd64-3.8pyopenclcompyte
creating buildlib.win-amd64-3.8pyopenclcompytendarray
copying pyopenclcompytendarraygen_elemwise.py -> buildlib.win-amd64-3.8pyopenclcompytendarray
copying pyopenclcompytendarraygen_reduction.py -> buildlib.win-amd64-3.8pyopenclcompytendarray
copying pyopenclcompytendarraysetup_opencl.py -> buildlib.win-amd64-3.8pyopenclcompytendarray
copying pyopenclcompytendarraytest_gpu_elemwise.py -> buildlib.win-amd64-3.8pyopenclcompytendarray
copying pyopenclcompytendarraytest_gpu_ndarray.py -> buildlib.win-amd64-3.8pyopenclcompytendarray
copying pyopenclcompytendarray__init__.py -> buildlib.win-amd64-3.8pyopenclcompytendarray
running egg_info
writing pyopencl.egg-infoPKG-INFO
writing dependency_links to pyopencl.egg-infodependency_links.txt
writing requirements to pyopencl.egg-inforequires.txt
writing top-level names to pyopencl.egg-infotop_level.txt
reading manifest file 'pyopencl.egg-infoSOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'pyopencl.egg-infoSOURCES.txt'
creating buildlib.win-amd64-3.8pyopenclcl
copying pyopenclclpyopencl-airy.cl -> buildlib.win-amd64-3.8pyopenclcl
copying pyopenclclpyopencl-bessel-j-complex.cl -> buildlib.win-amd64-3.8pyopenclcl
copying pyopenclclpyopencl-bessel-j.cl -> buildlib.win-amd64-3.8pyopenclcl
copying pyopenclclpyopencl-bessel-y.cl -> buildlib.win-amd64-3.8pyopenclcl
copying pyopenclclpyopencl-complex.h -> buildlib.win-amd64-3.8pyopenclcl
copying pyopenclclpyopencl-eval-tbl.cl -> buildlib.win-amd64-3.8pyopenclcl
copying pyopenclclpyopencl-hankel-complex.cl -> buildlib.win-amd64-3.8pyopenclcl
copying pyopenclclpyopencl-ranluxcl.cl -> buildlib.win-amd64-3.8pyopenclcl
creating buildlib.win-amd64-3.8pyopenclclpyopencl-random123
copying pyopenclclpyopencl-random123array.h -> buildlib.win-amd64-3.8pyopenclclpyopencl-random123
copying pyopenclclpyopencl-random123openclfeatures.h -> buildlib.win-amd64-3.8pyopenclclpyopencl-random123
copying pyopenclclpyopencl-random123philox.cl -> buildlib.win-amd64-3.8pyopenclclpyopencl-random123
copying pyopenclclpyopencl-random123threefry.cl -> buildlib.win-amd64-3.8pyopenclclpyopencl-random123
running build_ext
building 'pyopencl._cl' extension
creating buildtemp.win-amd64-3.8
creating buildtemp.win-amd64-3.8Release
creating buildtemp.win-amd64-3.8Releasesrc
C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.29.30133binHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYGPU_PACKAGE=pyopencl -DPYGPU_PYOPENCL=1 -Ipybind11/include -Ic:usersUserNameanaconda3libsite-packagespybind11include -Ic:usersUserNameanaconda3libsite-packagesnumpycoreinclude -Ic:usersUserNameanaconda3include -Ic:usersUserNameanaconda3include "-IC:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.29.30133include" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0ucrt" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0um" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0cppwinrt" /EHsc /Tpsrc/wrap_constants.cpp /Fobuildtemp.win-amd64-3.8Releasesrc/wrap_constants.obj -fvisibility=hidden /EHsc /DVERSION_INFO="2021.2.8"
cl : Command line warning D9002 : ignoring unknown option '-fvisibility=hidden'
wrap_constants.cpp
C:UsersUserNameAppDataLocalTemppip-install-uotqx7jspyopencl_da23417ff44f4dcf9ac1442acec7e11bsrcwrap_cl.hpp(70): fatal error C1083: Cannot open include file: 'CL/cl.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:usersUserNameanaconda3python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\UserName\AppData\Local\Temp\pip-install-uotqx7js\pyopencl_da23417ff44f4dcf9ac1442acec7e11b\setup.py'"'"'; __file__='"'"'C:\Users\UserName\AppData\Local\Temp\pip-install-uotqx7js\pyopencl_da23417ff44f4dcf9ac1442acec7e11b\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersUserNameAppDataLocalTemppip-record-7cpcxmrkinstall-record.txt' --single-version-externally-managed --compile --install-headers 'c:usersUserNameanaconda3Includepyopencl' Check the logs for full command output.
pyopencl似乎是一个源代码包。文档包含一些关于如何从源代码构建的说明。然而,它也包括更方便的替代方案。
引自安装说明:
安装PyOpenCL
到目前为止,安装PyOpenCL最简单的方法是使用Conda Forge中提供的包。
您还可以使用Christoph Gohlke二进制的轮子。