NVIDIA / NVIDIA/Megatron-LM

Unable to install on Windows

Open
#2,609 4 comments 0 reactions 1 assignee Claimed by @ko3n1g View on GitHub
bug community-request waiting-on-customer
Dominant language
Python
Stars
17.9k
Forks
4.5k
Avg merge
4d 6h
Merged PRs (30d)
271

Description

**Describe the bug**

```powershell
> uv sync
Resolved 216 packages in 301ms
× Failed to build `megatron-core==0.14.0`
├─▶ The build backend returned an error
╰─▶ Call to `setuptools.build_meta.build_wheel` failed (exit code: 1)

[stderr]
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Apps > Advanced app settings > App execution aliases.
Traceback (most recent call last):
File "", line 14, in
requires = get_requires_for_build({})
File "C:\Users\Saksham\AppData\Local\uv\cache\builds-v0\.tmp1sKzT0\Lib\site-packages\setuptools\build_meta.py", line 331, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Saksham\AppData\Local\uv\cache\builds-v0\.tmp1sKzT0\Lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires
self.run_setup()
~~~~~~~~~~~~~~^^
File "C:\Users\Saksham\AppData\Local\uv\cache\builds-v0\.tmp1sKzT0\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup
exec(code, locals())
~~~~^^^^^^^^^^^^^^^^
File "", line 12, in
get_requires_for_build = getattr(backend, "get_requires_for_build_wheel", None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Saksham\AppData\Roaming\uv\python\cpython-3.13.9-windows-x86_64-none\Lib\subprocess.py", line 472, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**kwargs).stdout
^^^^^^^^^
File "C:\Users\Saksham\AppData\Roaming\uv\python\cpython-3.13.9-windows-x86_64-none\Lib\subprocess.py", line 577, in run
raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['python3', '-m', 'pybind11', '--includes']' returned non-zero exit status 9009.

hint: This usually indicates a problem with the package or the build environment.
help: `megatron-core` (v0.14.0) was included because `reproduction` (v0.1.0) depends on `megatron-core`
```

**Steps/Code to reproduce bug**

```toml
[project]
name = "reproduction"
version = "0.1.0"
description = "demonstrating uv issues"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"nemo-toolkit[asr]>=2.6.0",
"tinytag>=2.1.2",
"megatron-core[lts]>=0.14",
"cuda-python[all]>=13.1.0",
"torch>=2.9.1",
]

[tool.uv.sources]
torch = [{ index = "pytorch-cu130" }]
torchvision = [{ index = "pytorch-cu130"}]

[tool.uv]
pip.strict = true
required-environments = ["sys_platform == 'win32'"]
override-dependencies = [
"ml_dtypes>=0.5.3",
"pydub @ git+https://github.com/jiaaro/pydub"
]

[[tool.uv.index]]
name = "pytorch-cu130"
url = "https://download.pytorch.org/whl/cu130"
explicit = true

```

It seems like the `setup.py` is using `python3` and it wont work if the alias is turned off in windows like this:

Image

The setup should check if the python3 alias exists or use the `python` executable from the path. i'm not sure how to make this work with `uv` but the repo has a `uv.lock` so I assume it should work

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.