简体   繁体   中英

CL/cl.h file not found Visual Studio with Windows C++ build tools installed

I am trying to use pip install but I am stuck on this error message I don't understand. I am running Visual Studio Code on Windows 10, with Python 3.7.7. I am rather new to Python and Visual Studio Code and every google search I try in order to find out what it is asking for only turns up results that are at least 2 years old. Can someone help me understand this CL/cl.h file its asking for and how to handle this error?

PS C:\Users\akree> pip install bfast
Collecting bfast
  Using cached bfast-0.3.3-py3-none-any.whl (622 kB)
Requirement already satisfied: scipy==1.2.1 in c:\users\akree\appdata\local\programs\python\python37\lib\site-packages (from bfast) (1.2.1)
Collecting pyopencl==2018.2.5
  Using cached pyopencl-2018.2.5.tar.gz (340 kB)
Requirement already satisfied: wget==3.2 in c:\users\akree\appdata\local\programs\python\python37\lib\site-packages (from bfast) (3.2)
Requirement already satisfied: pandas==0.24.2 in c:\users\akree\appdata\local\programs\python\python37\lib\site-packages (from bfast) (0.24.2)
Requirement already satisfied: numpy>=1.11.0 in c:\users\akree\appdata\local\programs\python\python37\lib\site-packages (from bfast) (1.18.2)
Requirement already satisfied: matplotlib==2.2.2 in c:\users\akree\appdata\local\programs\python\python37\lib\site-packages (from bfast) (2.2.2)
Requirement already satisfied: scikit-learn==0.20.3 in c:\users\akree\appdata\local\programs\python\python37\lib\site-packages (from bfast) (0.20.3)
Requirement already satisfied: pytools>=2017.6 in c:\users\akree\appdata\local\programs\python\python37\lib\site-packages (from pyopencl==2018.2.5->bfast) (2020.1)
Requirement already satisfied: decorator>=3.2.0 in c:\users\akree\appdata\local\programs\python\python37\lib\site-packages (from pyopencl==2018.2.5->bfast) (4.4.2)
Requirement already satisfied: appdirs>=1.4.0 in c:\users\akree\appdata\local\programs\python\python37\lib\site-packages (from pyopencl==2018.2.5->bfast) (1.4.3)
Requirement already satisfied: six>=1.9.0 in c:\users\akree\appdata\roaming\python\python37\site-packages (from pyopencl==2018.2.5->bfast) (1.14.0)
Requirement already satisfied: pytz>=2011k in c:\users\akree\appdata\local\programs\python\python37\lib\site-packages (from pandas==0.24.2->bfast) (2019.3)
Requirement already satisfied: python-dateutil>=2.5.0 in c:\users\akree\appdata\local\programs\python\python37\lib\site-packages (from pandas==0.24.2->bfast) (2.8.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in c:\users\akree\appdata\local\programs\python\python37\lib\site-packages (from matplotlib==2.2.2->bfast) (2.4.6)  
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\akree\appdata\local\programs\python\python37\lib\site-packages (from matplotlib==2.2.2->bfast) (1.1.0)
Requirement already satisfied: cycler>=0.10 in c:\users\akree\appdata\local\programs\python\python37\lib\site-packages (from matplotlib==2.2.2->bfast) (0.10.0)
Requirement already satisfied: setuptools in c:\users\akree\appdata\local\programs\python\python37\lib\site-packages (from kiwisolver>=1.0.1->matplotlib==2.2.2->bfast) (41.2.0)
Installing collected packages: pyopencl, bfast
    Running setup.py install for pyopencl ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\akree\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\akree\\AppData\\Local\\Temp\\pip-install-_ynmp7xp\\pyopencl\\setup.py'"'"'; __file__='"'"'C:\\Users\\akree\\AppData\\Local\\Temp\\pip-install-_ynmp7xp\\pyopencl\\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\akree\AppData\Local\Temp\pip-record-momlw083\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\akree\appdata\local\programs\python\python37\Include\pyopencl'
         cwd: C:\Users\akree\AppData\Local\Temp\pip-install-_ynmp7xp\pyopencl\
    Complete output (76 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.7
    creating build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\algorithm.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\array.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\bitonic_sort.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\bitonic_sort_templates.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\cache.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\capture_call.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\clmath.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\clrandom.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\cltypes.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\elementwise.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\invoker.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\ipython_ext.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\reduction.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\scan.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\tools.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\version.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\_buffers.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\_cluda.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\_mymako.py -> build\lib.win-amd64-3.7\pyopencl
    copying pyopencl\__init__.py -> build\lib.win-amd64-3.7\pyopencl
    creating build\lib.win-amd64-3.7\pyopencl\characterize
    copying pyopencl\characterize\performance.py -> build\lib.win-amd64-3.7\pyopencl\characterize
    copying pyopencl\characterize\__init__.py -> build\lib.win-amd64-3.7\pyopencl\characterize
    creating build\lib.win-amd64-3.7\pyopencl\compyte
    copying pyopencl\compyte\array.py -> build\lib.win-amd64-3.7\pyopencl\compyte
    copying pyopencl\compyte\dtypes.py -> build\lib.win-amd64-3.7\pyopencl\compyte
    copying pyopencl\compyte\__init__.py -> build\lib.win-amd64-3.7\pyopencl\compyte
    creating build\lib.win-amd64-3.7\pyopencl\compyte\ndarray
    copying pyopencl\compyte\ndarray\gen_elemwise.py -> build\lib.win-amd64-3.7\pyopencl\compyte\ndarray
    copying pyopencl\compyte\ndarray\gen_reduction.py -> build\lib.win-amd64-3.7\pyopencl\compyte\ndarray
    copying pyopencl\compyte\ndarray\setup_opencl.py -> build\lib.win-amd64-3.7\pyopencl\compyte\ndarray
    copying pyopencl\compyte\ndarray\test_gpu_elemwise.py -> build\lib.win-amd64-3.7\pyopencl\compyte\ndarray
    copying pyopencl\compyte\ndarray\test_gpu_ndarray.py -> build\lib.win-amd64-3.7\pyopencl\compyte\ndarray
    copying pyopencl\compyte\ndarray\__init__.py -> build\lib.win-amd64-3.7\pyopencl\compyte\ndarray
    running egg_info
    writing pyopencl.egg-info\PKG-INFO
    writing dependency_links to pyopencl.egg-info\dependency_links.txt
    writing top-level names to pyopencl.egg-info\top_level.txt
    reading manifest file 'pyopencl.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*.h'
    warning: no files found matching 'doc\_static\*.css'
    warning: no files found matching 'doc\_templates\*.html'
    warning: no files found matching '*.py.in'
    writing manifest file 'pyopencl.egg-info\SOURCES.txt'
    copying pyopencl\cl\pyopencl-airy.cl -> build\lib.win-amd64-3.7\pyopencl\cl
    copying pyopencl\cl\pyopencl-bessel-j-complex.cl -> build\lib.win-amd64-3.7\pyopencl\cl
    copying pyopencl\cl\pyopencl-bessel-j.cl -> build\lib.win-amd64-3.7\pyopencl\cl
    copying pyopencl\cl\pyopencl-bessel-y.cl -> build\lib.win-amd64-3.7\pyopencl\cl
    copying pyopencl\cl\pyopencl-complex.h -> build\lib.win-amd64-3.7\pyopencl\cl
    copying pyopencl\cl\pyopencl-eval-tbl.cl -> build\lib.win-amd64-3.7\pyopencl\cl
    copying pyopencl\cl\pyopencl-hankel-complex.cl -> build\lib.win-amd64-3.7\pyopencl\cl
    copying pyopencl\cl\pyopencl-ranluxcl.cl -> build\lib.win-amd64-3.7\pyopencl\cl
    creating build\lib.win-amd64-3.7\pyopencl\cl\pyopencl-random123
    copying pyopencl\cl\pyopencl-random123\array.h -> build\lib.win-amd64-3.7\pyopencl\cl\pyopencl-random123
    copying pyopencl\cl\pyopencl-random123\openclfeatures.h -> build\lib.win-amd64-3.7\pyopencl\cl\pyopencl-random123
    copying pyopencl\cl\pyopencl-random123\philox.cl -> build\lib.win-amd64-3.7\pyopencl\cl\pyopencl-random123
    copying pyopencl\cl\pyopencl-random123\threefry.cl -> build\lib.win-amd64-3.7\pyopencl\cl\pyopencl-random123
    running build_ext
    building 'pyopencl._cl' extension
    creating build\temp.win-amd64-3.7
    creating build\temp.win-amd64-3.7\Release
    creating build\temp.win-amd64-3.7\Release\src
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYGPU_PACKAGE=pyopencl -DPYGPU_PYOPENCL=1 -Ipybind11/include -Ic:\users\akree\appdata\local\programs\python\python37\Include -IC:\Users\akree\AppData\Roaming\Python\Python37\Include -Ic:\users\akree\appdata\local\programs\python\python37\lib\site-packages\numpy\core\include -Ic:\users\akree\appdata\local\programs\python\python37\include -Ic:\users\akree\appdata\local\programs\python\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /EHsc /Tpsrc/wrap_constants.cpp /Fobuild\temp.win-amd64-3.7\Release\src/wrap_constants.obj -fvisibility=hidden /EHsc /DVERSION_INFO=\"2018.2.5\"
    cl : Command line warning D9002 : ignoring unknown option '-fvisibility=hidden'
    wrap_constants.cpp
    C:\Users\akree\AppData\Local\Temp\pip-install-_ynmp7xp\pyopencl\src\wrap_cl.hpp(57): 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.25.28610\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\akree\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\akree\\AppData\\Local\\Temp\\pip-install-_ynmp7xp\\pyopencl\\setup.py'"'"'; __file__='"'"'C:\\Users\\akree\\AppData\\Local\\Temp\\pip-install-_ynmp7xp\\pyopencl\\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\akree\AppData\Local\Temp\pip-record-momlw083\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\akree\appdata\local\programs\python\python37\Include\pyopencl' Check the logs for full command output.

It probably means the source distribution file is missing CL/cl.h . You can either reach out to the project or try to install using conda as there appears to be conda packages for Windows according to the documentation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM