Skip to content

Conversation

@hiden0
Copy link

@hiden0 hiden0 commented Oct 20, 2025

This PR fixes a ModuleNotFoundError: No module named 'torch' that occurs when trying to install the package in a clean environment (e.g., using pip install -e .).

Problem: The setup.py script imports torch at build time. However, because torch was not specified as a build-system requirement, pip would create an isolated build environment that did not have torch installed, causing the installation to fail.

Solution: By adding torch to the build-system.requires list in pyproject.toml, we ensure that pip (or any PEP 517 compliant build tool) installs PyTorch into the isolated build environment before executing setup.py.

This allows the installation to complete successfully without requiring the user to manually install torch beforehand or use the --no-build-isolation flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant