Conda build / Build fails with `ModuleNotFoundError: No module named 'setuptools'`
Closed this issue · 2 comments
hendrikmakait commented
CI run: https://github.com/dask/dask-expr/actions/runs/11275728776/job/31357856215
@charlesbluca, do you have an idea what's going on?
Full traceback:
Running command Preparing metadata (pyproject.toml)
ERROR: Exception:
Traceback (most recent call last):
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/cli/base_command.py", line 105, in _run_wrapper
status = _inner_run()
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/cli/base_command.py", line 96, in _inner_run
return self.run(options, args)
~~~~~~~~^^^^^^^^^^^^^^^
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
return func(self, options, args)
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/commands/install.py", line 379, in run
requirement_set = resolver.resolve(
reqs, check_supported_wheels=not options.target_dir
)
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 76, in resolve
collected = self.factory.collect_root_requirements(root_reqs)
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 539, in collect_root_requirements
reqs = list(
self._make_requirements_from_install_req(
...<2 lines>...
)
)
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 495, in _make_requirements_from_install_req
cand = self._make_base_candidate_from_link(
ireq.link,
...<2 lines>...
version=None,
)
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 232, in _make_base_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
~~~~~~~~~~~~~^
link,
^^^^^
...<3 lines>...
version=version,
^^^^^^^^^^^^^^^^
)
^
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 303, in __init__
super().__init__(
~~~~~~~~~~~~~~~~^
link=link,
^^^^^^^^^^
...<4 lines>...
version=version,
^^^^^^^^^^^^^^^^
)
^
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 158, in __init__
self.dist = self._prepare()
~~~~~~~~~~~~~^^
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 235, in _prepare
dist = self._prepare_distribution()
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 314, in _prepare_distribution
return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/operations/prepare.py", line 527, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/operations/prepare.py", line 642, in _prepare_linked_requirement
dist = _get_prepared_distribution(
req,
...<3 lines>...
self.check_build_deps,
)
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/operations/prepare.py", line 72, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
finder, build_isolation, check_build_deps
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/distributions/sdist.py", line 69, in prepare_distribution_metadata
self.req.prepare_metadata()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/req/req_install.py", line 575, in prepare_metadata
self.metadata_directory = generate_metadata(
~~~~~~~~~~~~~~~~~^
build_env=self.build_env,
^^^^^^^^^^^^^^^^^^^^^^^^^
backend=self.pep517_backend,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
details=details,
^^^^^^^^^^^^^^^^
)
^
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/operations/build/metadata.py", line 35, in generate_metadata
distinfo_dir = backend.prepare_metadata_for_build_wheel(metadata_dir)
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_internal/utils/misc.py", line 727, in prepare_metadata_for_build_wheel
return super().prepare_metadata_for_build_wheel(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
metadata_directory=metadata_directory,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
config_settings=cs,
^^^^^^^^^^^^^^^^^^^
_allow_fallback=_allow_fallback,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 186, in prepare_metadata_for_build_wheel
return self._call_hook('prepare_metadata_for_build_wheel', {
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'metadata_directory': abspath(metadata_directory),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'config_settings': config_settings,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'_allow_fallback': _allow_fallback,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
})
^^
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 321, in _call_hook
raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last):
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
obj = import_module(mod_path)
File "/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.13/importlib/__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line [131](https://github.com/dask/dask-expr/actions/runs/11275728776/job/31357856215#step:5:132)0, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'setuptools'
Traceback (most recent call last):
source tree in: /home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/work
File "/home/runner/miniconda3/envs/test/bin/conda-mambabuild", line 10, in <module>
export PREFIX=/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_
export BUILD_PREFIX=/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/_build_env
export SRC_DIR=/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/work
Using pip 24.2 from $PREFIX/lib/python3.13/site-packages/pip (python 3.13)
Non-user install because user site-packages disabled
Ignoring indexes: https://pypi.org/simple
Created temporary directory: /tmp/pip-build-tracker-vmse1vus
Initialized build tracking at /tmp/pip-build-tracker-vmse1vus
Created build tracker: /tmp/pip-build-tracker-vmse1vus
Entered build tracker: /tmp/pip-build-tracker-vmse1vus
Created temporary directory: /tmp/pip-install-f179yne6
Created temporary directory: /tmp/pip-ephem-wheel-cache-5qoj_6q9
Processing $SRC_DIR
Added file://$SRC_DIR to build tracker '/tmp/pip-build-tracker-vmse1vus'
Created temporary directory: /tmp/pip-modern-metadata-0n537ug_
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Removed file://$SRC_DIR from build tracker '/tmp/pip-build-tracker-vmse1vus'
Removed build tracker: '/tmp/pip-build-tracker-vmse1vus'
sys.exit(main())
File "/home/runner/miniconda3/envs/test/lib/python3.9/site-packages/boa/cli/mambabuild.py", line 301, in main
call_conda_build(action, config)
File "/home/runner/miniconda3/envs/test/lib/python3.9/site-packages/boa/cli/mambabuild.py", line 273, in call_conda_build
result = api.build(
File "/home/runner/miniconda3/envs/test/lib/python3.9/site-packages/conda_build/api.py", line 250, in build
return build_tree(
File "/home/runner/miniconda3/envs/test/lib/python3.9/site-packages/conda_build/build.py", line 3638, in build_tree
packages_from_this = build(
File "/home/runner/miniconda3/envs/test/lib/python3.9/site-packages/conda_build/build.py", line 2506, in build
utils.check_call_env(
File "/home/runner/miniconda3/envs/test/lib/python3.9/site-packages/conda_build/utils.py", line 405, in check_call_env
return _func_defaulting_env_to_os_environ("call", *popenargs, **kwargs)
File "/home/runner/miniconda3/envs/test/lib/python3.9/site-packages/conda_build/utils.py", line 381, in _func_defaulting_env_to_os_environ
raise subprocess.CalledProcessError(proc.returncode, _args)
subprocess.CalledProcessError: Command '['/bin/bash', '-o', 'errexit', '/home/runner/miniconda3/envs/test/conda-bld/dask-expr_1728569285440/work/conda_build.sh']' returned non-zero exit status 2.
charlesbluca commented
Will take a deeper look into this now, my first guess here is that since we aren't specifying this package's dependency on setuptools
explicitly in the conda recipe, a package that was implicitly pulling it for us no longer lists it as a dependency
charlesbluca commented
Seems like this change is intentional from conda-forge with Python 3.13, and adding setuptools
as an explicit build/host dependency is the recommended advice:
https://conda-forge.org/news/2024/08/21/sunsetting-pip-deps/
Done in #1151, assume we'll want to do this for the other conda recipes as well