Jittor / jittor

Jittor is a high-performance deep learning framework based on JIT compiling and meta-operators.
https://cg.cs.tsinghua.edu.cn/jittor/
Apache License 2.0
3.08k stars 311 forks source link

Cannot open include file: 'Python.h' : no such file or directory #424

Open Glass047 opened 1 year ago

Glass047 commented 1 year ago

Describe the bug

I want to test if I install jittor successful and I input test.test_core, then it said that d:\python project\test01\venv\lib\site-packages\jittor\src\pyjt/py_obj_holder.h(8): fatal error C1083: Cannot open include file: 'Python.h': No such file or directory

Full Log

PS D:\Python project\test01> python -m jittor.test.testcore [i 0326 00:10:51.109332 64 compiler.py:955] Jittor(1.3.6.14) src: d:\python project\test01\venv\lib\site-packages\jittor [i 0326 00:10:51.124174 64 compiler.py:956] cl at C:\Users\Administrator.cache\jittor\msvc\VC____\\bin\cl.exe(19.29.30133) [i 0326 00:10:51.124174 64 compiler.py:957] cache_path: C:\Users\Administrator.cache\jittor\jt1.3.6\cl\py3.8.10\Windows-10-10.x86\12thGenIntelRCx01\default [i 0326 00:10:51.127164 64 install_cuda.py:93] cuda_driver_version: [12, 1, 0] [i 0326 00:10:51.140121 64 init.py:411] Found C:\Users\Administrator.cache\jittor\jtcuda\cuda11.2_cudnn8_win\bin\nvcc.exe(11.2.67) at C:\Users\Administrator.cache\jittor\jtcuda\cuda11.2_cudnn8_win\bin\nvcc.exe. [i 0326 00:10:51.170022 64 compiler.py:1010] cuda key:cu11.2.67 [i 0326 00:10:51.170022 64 init.py:227] Total mem: 63.86GB, using 16 procs for compiling. jit_utils.cc d:\python project\test01\venv\lib\site-packages\jittor\src\pyjt/py_obj_holder.h(8): fatal error C1083: Cannot open include file: 'Python.h': No such file or directory multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64qbz5n2kfra8p0\lib\multiprocessing\pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "D:\Python project\test01\venv\lib\site-packages\jittor_utils__init__.py", line 199, in do_compile run_cmd(cmd) File "D:\Python project\test01\venv\lib\site-packages\jittor_utils\init__.py", line 188, in run_cmd raise Exception(errmsg) Exception: Run cmd failed: "C:\Users\Administrator.cache\jittor\msvc\VC____\\bin\cl.exe" "d:\python project\test01\venv\lib\site-packages\jittor\src\utils\jit_utils.cc" -std:c++17 -EHa -MD -utf-8 -nologo -I"C:\Users\ Administrator.cache\jittor\msvc\VC\include" -I"C:\Users\Administrator.cache\jittor\msvc\win10_kits\include\ucrt" -I"C:\Users\Administrator.cache\jittor\msvc\win10_kits\include\shared" -I"C:\Users\Administrator.cache\jittor\msvc\ win10_kits\include\um" -DNOMINMAX -I"d:\python project\test01\venv\lib\site-packages\jittor\src" -I"d:\python project\test01\venv\scripts\include" -O2 -c -Fo: "C:\Users\Administrator.cache\jittor\jt1.3.6\cl\py3.8.10\Windows-1 0-10.x86\12thGenIntelRCx01\default\cu11.2.67\obj_files\jit_utils.cc.obj" """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64qbz5n2kfra8p0\lib\runpy.py", line 185, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 111, in _get_module_details import__(pkg_name) File "D:\Python project\test01\venv\lib\site-packages\jittor__init.py", line 18, in from . import compiler File "D:\Python project\test01\venv\lib\site-packages\jittor\compiler.py", line 1192, in check_cache_compile() File "D:\Python project\test01\venv\lib\site-packages\jittor\compiler.py", line 884, in check_cache_compile recompile = compile(cc_path, cc_flags+f" {opt_flags} ", files, jit_utils.cache_path+'/jit_utils_core'+extension_suffix, True) File "D:\Python project\test01\venv\lib\site-packages\jittor\compiler.py", line 151, in compile jit_utils.run_cmds(cmds, cache_path, jittor_path, "Compiling "+base_output) File "D:\Python project\test01\venv\lib\site-packages\jittor_utils\init.py", line 251, in runcmds for i, in enumerate(p.imap_unordered(do_compile, cmds)): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64qbz5n2kfra8p0\lib\multiprocessing\pool.py", line 868, in next raise value Exception: Run cmd failed: "C:\Users\Administrator.cache\jittor\msvc\VC_____\bin\cl.exe" "d:\python project\test01\venv\lib\site-packages\jittor\src\utils\jit_utils.cc" -std:c++17 -EHa -MD -utf-8 -nologo -I"C:\Users\ Administrator.cache\jittor\msvc\VC\include" -I"C:\Users\Administrator.cache\jittor\msvc\win10_kits\include\ucrt" -I"C:\Users\Administrator.cache\jittor\msvc\win10_kits\include\shared" -I"C:\Users\Administrator.cache\jittor\msvc\ win10_kits\include\um" -DNOMINMAX -I"d:\python project\test01\venv\lib\site-packages\jittor\src" -I"d:\python project\test01\venv\scripts\include" -O2 -c -Fo: "C:\Users\Administrator.cache\jittor\jt1.3.6\cl\py3.8.10\Windows-1 0-10.x86\12thGenIntelRCx01\default\cu11.2.67\obj_files\jit_utils.cc.obj"

My environment is Windows11 Pro and python version is 3.8.10, and I already try it on Linux but it still not works.

Glass047 commented 1 year ago

And running it in CMD also doesn't work either, I even delete other python version in case that the problem happens in different version of python.

cjld commented 1 year ago

update jittor to 1.3.7.10 will fix this bug