Issues with building libtorch without python dependencies

I am trying to build libtorch on an HPC with very limited python support (no dependencies). Since I am trying to utilize the C++ frontend only and

states that I don’t need python to build libtorch, I am wondering if anybody managed to do it without any python installation before. When I try to configure cmake, I get the following error:

File "/usr/local/lib/python3.7/", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.7/", line 85, in _run_code
    exec(code, run_globals)
  File "/raid/projects/pytorch/tools/codegen/", line 3, in <module>
    from typing_extensions import Literal
ModuleNotFoundError: No module named 'typing_extensions'

I see that cmake is actually checking my python directories, which is super weird since I don’t want to do anything with python. This is the cmake command that I tried in my build directory:


Any help would be much appreciated. Thanks!

Hi Peter, did you solve that?