Azure / Azure/azure-functions-core-tools
Error "ImportError: cannot import name 'packaging' from 'pkg_resources'"
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 498
- Avg merge
- 5d 4h
- Merged PRs (30d)
- 15
Description
Functions work locally, but on deployment to Azure the build fails with the following error:
ERROR: Command errored out with exit status 1:
command: /tmp/oryx/platforms/python/3.10.4/bin/python3.10 /tmp/oryx/platforms/python/3.10.4/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpatbakgzk
cwd: /tmp/pip-install-is7lf2_g/openpifpaf_d303d9d1f7294ff8be34d24fed130c3e
Complete output (17 lines):
Traceback (most recent call last):
File "/tmp/oryx/platforms/python/3.10.4/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in
main()
File "/tmp/oryx/platforms/python/3.10.4/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/tmp/oryx/platforms/python/3.10.4/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 117, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-35ct5gbh/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-35ct5gbh/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-35ct5gbh/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "", line 5, in
File "/tmp/pip-build-env-35ct5gbh/overlay/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 25, in
from pkg_resources import packaging # type: ignore[attr-defined]
ImportError: cannot import name 'packaging' from 'pkg_resources' (/tmp/pip-build-env-35ct5gbh/overlay/lib/python3.10/site-packages/pkg_resources/__init__.py)
Contributor guide
Research direction
Start by reproducing the Azure deployment using the reported Python 3.10.4 environment and the openpifpaf dependency, then trace the pip build-isolation failure involving setuptools, torch, and pkg_resources. Done means the deployment build completes without the reported ImportError; the issue names no repository files or tests to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, python
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100