Skip to content

ModuleNotFoundError: No module named 'torch' #2

@DragonFive

Description

@DragonFive

After I clone this repo and run following script

uv run --isolated --frozen pip3 show torch 

I get following error, how to solve it?

#9 820.5 Building xformers==0.0.29.post2
#9 820.9 × Failed to build xformers==0.0.29.post2
#9 820.9 ├─▶ The build backend returned an error
#9 820.9 ╰─▶ Call to setuptools.build_meta:__legacy__.build_wheel failed (exit
#9 820.9 status: 1)
#9 820.9
#9 820.9 [stderr]
#9 820.9 Traceback (most recent call last):
#9 820.9 File "", line 14, in
#9 820.9 File
#9 820.9 "/root/.cache/uv/builds-v0/.tmpTjUUjz/lib/python3.12/site-packages/setuptools/build_meta.py",
#9 820.9 line 331, in get_requires_for_build_wheel
#9 820.9 return self._get_build_requires(config_settings, requirements=[])
#9 820.9 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#9 820.9 File
#9 820.9 "/root/.cache/uv/builds-v0/.tmpTjUUjz/lib/python3.12/site-packages/setuptools/build_meta.py",
#9 820.9 line 301, in _get_build_requires
#9 820.9 self.run_setup()
#9 820.9 File
#9 820.9 "/root/.cache/uv/builds-v0/.tmpTjUUjz/lib/python3.12/site-packages/setuptools/build_meta.py",
#9 820.9 line 512, in run_setup
#9 820.9 super().run_setup(setup_script=setup_script)
#9 820.9 File
#9 820.9 "/root/.cache/uv/builds-v0/.tmpTjUUjz/lib/python3.12/site-packages/setuptools/build_meta.py",
#9 820.9 line 317, in run_setup
#9 820.9 exec(code, locals())
#9 820.9 File "", line 24, in
#9 820.9 ModuleNotFoundError: No module named 'torch'
#9 820.9
#9 820.9 hint: This error likely indicates that xformers@0.0.29.post2
#9 820.9 depends on torch, but doesn't declare it as a build dependency. If
#9 820.9 xformers is a first-party package, consider adding torch to its
#9 820.9 build-system.requires. Otherwise, uv pip install torch into the
#9 820.9 environment and re-run with --no-build-isolation.
#9 820.9 help: xformers (v0.0.29.post2) was included because verl depends on
#9 820.9 vllm (v0.8.2) which depends on xformers

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions