Azure / azure-functions-core-tools

Command line tools for Azure Functions
MIT License
1.31k stars 433 forks source link

Error "ImportError: cannot import name 'packaging' from 'pkg_resources'" #3694

Open iamragha opened 4 months ago

iamragha commented 4 months ago

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)

iamragha commented 4 months ago

Environment settings: Found Python version 3.10.10 (python3). Azure Functions Core Tools Core Tools Version: 4.0.5801 Commit hash: N/A +5ac2f09758b98257e728dd1b5576ce5ea9ef68ff (64-bit) Function Runtime Version: 4.34.1.22669