ros2
build_error
ai_generated
true
SetuptoolsDeprecationWarning: setup.py install is deprecated
ID: ros2/ament-python-setup-deprecated
85%Fix Rate
88%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 2 | active | — | — | — |
Root Cause
setuptools deprecated setup.py install. Affects ament_python packages. Warning may become error in future setuptools versions.
genericWorkarounds
-
80% success Pin setuptools < 58.2.0 only in your build virtualenv
pip install 'setuptools==58.2.0' # temporary, for colcon build only
-
88% success Migrate to pyproject.toml with [build-system] entry point
Add pyproject.toml with [build-system] requires=[setuptools, ament-package]
-
75% success Set PYTHONDONTWRITEBYTECODE=1 and ignore the warning if builds succeed
Dead Ends
Common approaches that don't work:
-
Downgrade setuptools to suppress the warning
78% fail
Pins to old version; breaks other packages that need modern setuptools features
-
Switch ament_python package to ament_cmake
82% fail
Requires rewriting the entire build system; ament_python is correct for pure Python packages