Getting error while building Docker image based on alpine

Getting this error while building docker image

× Getting requirements to build wheel did not run successfully.
 │ exit code: 1
 ╰─> [68 lines of output]
     /tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/config/ _DeprecatedConfig: Deprecated config in `setup.cfg`
             The license_file parameter is deprecated, use license_files instead.
             By 2023-Oct-30, you need to update your project and remove deprecated calls
             or your builds will no longer be supported.
             See for details.
       parsed = self.parsers.get(option_name, lambda x: x)(value)
     running egg_info
     writing lib3/PyYAML.egg-info/PKG-INFO
     writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
     writing top-level names to lib3/PyYAML.egg-info/top_level.txt
     Traceback (most recent call last):
       File "/usr/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/", line 353, in <module>
       File "/usr/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/", line 335, in main
         json_out['return_val'] = hook(**hook_input['kwargs'])
       File "/usr/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/", line 118, in get_requires_for_build_wheel
         return hook(config_settings)
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/", line 355, in get_requires_for_build_wheel
         return self._get_build_requires(config_settings, requirements=['wheel'])
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/", line 325, in _get_build_requires
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/", line 341, in run_setup
         exec(code, locals())
       File "<string>", line 271, in <module>
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/", line 107, in setup
         return distutils.core.setup(**attrs)
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/_distutils/", line 185, in setup
         return run_commands(dist)
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/_distutils/", line 201, in run_commands
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/_distutils/", line 969, in run_commands
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/", line 1233, in run_command
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/_distutils/", line 988, in run_command
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/command/", line 319, in run
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/command/", line 327, in find_sources
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/command/", line 549, in run
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/command/", line 587, in add_defaults
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/command/", line 113, in add_defaults
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/", line 251, in add_defaults
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/", line 336, in _add_defaults_ext
       File "<string>", line 201, in get_source_files
       File "/tmp/pip-build-env-lu3huh4t/overlay/lib/python3.11/site-packages/setuptools/_distutils/", line 107, in __getattr__
         raise AttributeError(attr)
     AttributeError: cython_sources
     [end of output]
 note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

Which Docker image? Is it an image you are creating yourself, or an image from Docket Hub?

What was the pip command that failed?

An error like the one you are seeing usually means something like:

  1. pip is trying to install a package from a source distribution
  2. pip tries to install the build requirements for the package, so it can make a wheel (binary) from the source distribution
  3. There is some dependency missing from the build environment, outside what pip is aware of or could install automatically, so step 2 fails.

This error will happen while trying to install a particular package. You should be able to see the name of the package pip was trying to build in the output before or after the error you posted. This will narrow down what might be missing from the build environment, as you can check that project’s documentation.

Because - I assume - pip is running inside the container while building the image, once you discover what dependency is missing it is a matter of adding that dependency to the image before the step that is failing.

image from docker hub image name> jenkins/inbound-agent based on alpine and on top of that I installd nodejs and yarn and top of that now i amy trying to package python3 dependency and aws-cli

Downloading aws_sam_cli-1.93.0-py3-none-any.whl.metadata (11 kB)
#7 680.8 Obtaining dependency information for aws-sam-cli>=1.80 from
#7 681.0 Downloading aws_sam_cli-1.92.0-py3-none-any.whl.metadata (12 kB)
#7 681.0 Collecting PyYAML==5.*,>=5.4.1 (from aws-sam-cli>=1.80)
#7 681.1 Downloading PyYAML-5.4.1.tar.gz (175 kB)
#7 681.2 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 175.1/175.1 kB 3.6 MB/s eta 0:00:00
#7 681.4 Installing build dependencies: started
#7 687.3 Installing build dependencies: finished with status ‘done’
#7 687.3 Getting requirements to build wheel: started
#7 687.7 Getting requirements to build wheel: finished with status ‘error’
#7 687.7 error: subprocess-exited-with-error
#7 687.7
#7 687.7 × Getting requirements to build wheel did not run successfully.
#7 687.7 │ exit code: 1
#7 687.7 ╰─> [62 lines of output]
#7 687.7 /tmp/pip-build-env-7y0tiayg/overlay/lib/python3.9/site-packages/setuptools/config/ _DeprecatedConfig: Deprecated config in setup.cfg

This is because of this issue:
Updating to PyYAML 6.0.1 should fix it

For Python 3.12

python - AttributeError: cython_sources - Stack Overflow