python
config_error
ai_generated
true
SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. Please see https://setuptools.pypa.io/en/latest/userguide/quickstart.html setup.py install ~~~~~~~~~~~~^ SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated.
ID: python/setuptools-find-namespace-packages-deprecated
80%Fix Rate
83%Confidence
0Evidence
2024-05-09First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
Root Cause
The project still uses the deprecated setup.py install path and namespace_packages keyword, which setuptools has deprecated in favor of PEP 420 native namespace packages and pyproject.toml-based builds.
generic中文
项目仍使用已弃用的 setup.py install 路径和 namespace_packages 关键字,setuptools 已弃用它们,推荐使用 PEP 420 原生命名空间包和基于 pyproject.toml 的构建。
Workarounds
-
85% success
# remove namespace_packages from setup.cfg/setup.py # rely on implicit namespace packages: # mypkg/sub/__init__.py (implicit, no __init__ needed at mypkg level) pip install -e .
-
90% success
python -m pip install build python -m build pip install dist/*.whl
Dead Ends
Common approaches that don't work:
-
70% fail
Suppresses warnings but the deprecated code path still runs and will be removed in future setuptools releases.
-
80% fail
Avoids the warning but blocks security fixes and breaks on Python 3.12+ where distutils is gone.