Closed cbornet closed 2 months ago
setuptools is correctly not installed because it is not a dependency for pytorch
$ curl -s https://pypi.org/pypi/torch/2.4.0/json | jq '.info.requires_dist'
[
"filelock",
"typing-extensions>=4.8.0",
"sympy",
"networkx",
"jinja2",
"fsspec",
"nvidia-cuda-nvrtc-cu12==12.1.105; platform_system == \"Linux\" and platform_machine == \"x86_64\"",
"nvidia-cuda-runtime-cu12==12.1.105; platform_system == \"Linux\" and platform_machine == \"x86_64\"",
"nvidia-cuda-cupti-cu12==12.1.105; platform_system == \"Linux\" and platform_machine == \"x86_64\"",
"nvidia-cudnn-cu12==9.1.0.70; platform_system == \"Linux\" and platform_machine == \"x86_64\"",
"nvidia-cublas-cu12==12.1.3.1; platform_system == \"Linux\" and platform_machine == \"x86_64\"",
"nvidia-cufft-cu12==11.0.2.54; platform_system == \"Linux\" and platform_machine == \"x86_64\"",
"nvidia-curand-cu12==10.3.2.106; platform_system == \"Linux\" and platform_machine == \"x86_64\"",
"nvidia-cusolver-cu12==11.4.5.107; platform_system == \"Linux\" and platform_machine == \"x86_64\"",
"nvidia-cusparse-cu12==12.1.0.106; platform_system == \"Linux\" and platform_machine == \"x86_64\"",
"nvidia-nccl-cu12==2.20.5; platform_system == \"Linux\" and platform_machine == \"x86_64\"",
"nvidia-nvtx-cu12==12.1.105; platform_system == \"Linux\" and platform_machine == \"x86_64\"",
"triton==3.0.0; platform_system == \"Linux\" and platform_machine == \"x86_64\" and python_version < \"3.13\"",
"opt-einsum>=3.3; extra == \"opt-einsum\"",
"optree>=0.11.0; extra == \"optree\""
]
please close
https://github.com/pytorch/pytorch/pull/127921 was wrong, or anyway not compatible with poetry (and other tools that implement cross-platform locking)
you don't want
if sys.version_info >= (3, 12, 0):
install_requires.append("setuptools")
you do want
install_requires.append('setuptools; python_version >= "3.12"')
Thanks for the analysis. I'll propose a patch on pytorch.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Description
setuptools is not installed when it is a transitive dependency on Python 3.12.
For instance pytorch 2.4.0 pulls setuptools.
Steps to reproduce:
[tool.poetry.dependencies] python = "^3.12" torch = "2.4.0"
[build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api"
We see that setuptools was not installed by poetry.
We see that setuptools is installed when using pip.
Workarounds
Explicitly pulling setuptools in pyproject:
Poetry Installation Method
pip
Operating System
Seen on MacOS and Ubuntu
Poetry Version
Poetry (version 1.8.3)
Poetry Configuration
Python Sysconfig
No response
Example pyproject.toml
No response
Poetry Runtime Logs