Проблема с установкой PyOpenCL

#python

Вопрос:

Я пытаюсь установить PyOpenCL и получаю эту ошибку. Я уже пытался установить .файлы whl непосредственно в папку пакетов сайта и запуск 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.
 

Комментарии:

1. В документации утверждается, что установка Windows не была протестирована documen.tician.de/pyopencl/misc.html#installation

2. Для Windows вы всегда можете использовать двоичные файлы из неофициального репозитория Gohlke: lfd.uci.edu/~gohlke/pythonlibs/#pyopencl

Ответ №1:

pyopencl, по-видимому, является исходным пакетом. Документация содержит некоторые инструкции о том, как создавать из исходного кода, если вы хотите. Однако он также включает в себя более удобные альтернативы.

Приведено в инструкции по установке:

Установка PyOpenCL

Безусловно, самый простой способ установить PyOpenCL-это использовать пакеты, доступные в Conda Forge.

Вы также можете использовать бинарные колеса Кристофа Голке.