pytorch - 💡(How to fix) Fix [BUILD] Torch version generator script failure [2 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

[1/192] Regenerating version file... FAILED: [code=1] caffe2/torch/CMakeFiles/gen_torch_version [...]/pytorch/torch/version.py [...]/pytorch/build/caffe2/torch/CMakeFiles/gen_torch_version cd [...]/pytorch && python [...]/pytorch/torch/../tools/generate_torch_version.py --is-debug=1 --cuda-version=12.9 --hip-version= --rocm-version= --xpu-version= Traceback (most recent call last): File "[...]/pytorch/torch/../tools/generate_torch_version.py", line 117, in <module> from tools.strtobool import strtobool ModuleNotFoundError: No module named 'tools'

Root Cause

After latest Pytorch updates, I am getting build time failures of the Torch version generation step:

[1/192] Regenerating version file...
FAILED: [code=1] caffe2/torch/CMakeFiles/gen_torch_version [...]/pytorch/torch/version.py [...]/pytorch/build/caffe2/torch/CMakeFiles/gen_torch_version 
cd [...]/pytorch && python [...]/pytorch/torch/../tools/generate_torch_version.py --is-debug=1 --cuda-version=12.9 --hip-version= --rocm-version= --xpu-version=
Traceback (most recent call last):
  File "[...]/pytorch/torch/../tools/generate_torch_version.py", line 117, in <module>
    from tools.strtobool import strtobool
ModuleNotFoundError: No module named 'tools'

How can this be fixed? Because it is causing a job failure cascade, and I cannot seem to manually fix it myself.

Fix Action

Fixed

Code Example

[1/192] Regenerating version file...
FAILED: [code=1] caffe2/torch/CMakeFiles/gen_torch_version [...]/pytorch/torch/version.py [...]/pytorch/build/caffe2/torch/CMakeFiles/gen_torch_version 
cd [...]/pytorch && python [...]/pytorch/torch/../tools/generate_torch_version.py --is-debug=1 --cuda-version=12.9 --hip-version= --rocm-version= --xpu-version=
Traceback (most recent call last):
  File "[...]/pytorch/torch/../tools/generate_torch_version.py", line 117, in <module>
    from tools.strtobool import strtobool
ModuleNotFoundError: No module named 'tools'
RAW_BUFFERClick to expand / collapse

After latest Pytorch updates, I am getting build time failures of the Torch version generation step:

[1/192] Regenerating version file...
FAILED: [code=1] caffe2/torch/CMakeFiles/gen_torch_version [...]/pytorch/torch/version.py [...]/pytorch/build/caffe2/torch/CMakeFiles/gen_torch_version 
cd [...]/pytorch && python [...]/pytorch/torch/../tools/generate_torch_version.py --is-debug=1 --cuda-version=12.9 --hip-version= --rocm-version= --xpu-version=
Traceback (most recent call last):
  File "[...]/pytorch/torch/../tools/generate_torch_version.py", line 117, in <module>
    from tools.strtobool import strtobool
ModuleNotFoundError: No module named 'tools'

How can this be fixed? Because it is causing a job failure cascade, and I cannot seem to manually fix it myself.

cc @malfet

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING