ModuleNotFoundError: No module named 'setuptools'
Author: lake-hopeCreated Feb 14, 2024Updated Feb 7, 2025
Steps to Reproduce
- Have an existing project with a
setup.pyfile - Run
rye init
The setup.py is extremely simple:
from setuptools import setup
# See setup.cfg file
if __name__ == "__main__":
setup()I know the docs say "Note that Rye today does not support setup.py based projects," but also I found this issue, which suggests rye init should work in some capacity.
I guess rye init --no-import could be a workaround, but that would complicate the project setup.
I also uninstalled and re-installed Rye to make sure it wasn't some issue with my installation.
Expected Result
The project can be initialized successfully.
Actual Result
error: failed to proxy setup.py
Traceback (most recent call last):
File "/Users/annahope/<project>/./setup.py", line 2, in <module>
from setuptools import setup
File "/var/folders/b6/nm_w0grs5vx0_xq0tpsvft6h0000gn/T/.tmpmXonDM/setuptools.py", line 12, in <module>
import setuptools as __setuptools
File "/var/folders/b6/nm_w0grs5vx0_xq0tpsvft6h0000gn/T/.tmpmXonDM/setuptools.py", line 12, in <module>
import setuptools as __setuptools
ModuleNotFoundError: No module named 'setuptools'Version Info
rye 0.23.0 commit: 0.23.0 (0fdcdda6c 2024-02-13) platform: macos (aarch64) self-python: [email protected] symlink support: true
Stacktrace
No response
Source: astral-sh/rye