Skip to content

func start with python function '_SixMetaPathImporter' object has no attribute '_path' #4435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
es-cs1 opened this issue May 22, 2025 · 3 comments

Comments

@es-cs1
Copy link

es-cs1 commented May 22, 2025

Version

windows 11

$ func start
Found Python version 3.12.0 (py).

Azure Functions Core Tools
Core Tools Version: 4.0.7030 Commit hash: N/A +bb4c949899cd5659d6bfe8b92cc923453a2e8f88 (64-bit)
Function Runtime Version: 4.1037.0.23568

Description

fulloutput trying to start

$ func start
Found Python version 3.12.0 (py).

Azure Functions Core Tools
Core Tools Version:       4.0.7030 Commit hash: N/A +bb4c949899cd5659d6bfe8b92cc923453a2e8f88 (64-bit)
Function Runtime Version: 4.1037.0.23568

[2025-05-22T22:09:54.586Z]  ERROR: unhandled error in functions worker: '_SixMetaPathImporter' object has no attribute '_path'
[2025-05-22T22:09:54.634Z] Language Worker Process exited. Pid=7708.
[2025-05-22T22:09:54.636Z] py exited with code 1 (0x1). AttributeError: '_SixMetaPathImporter' object has no attribute '_path',AttributeError: '_SixMetaPathImporter' object has no attribute '_path',AttributeError: '_SixMetaPathImporter' object has no attribute '_path'.
[2025-05-22T22:10:52.094Z] Starting worker process failed
[2025-05-22T22:10:52.096Z] Microsoft.Azure.WebJobs.Script.Grpc: The operation has timed out.
[2025-05-22T22:10:52.099Z] Failed to start language worker process for runtime: python. workerId:99ec6883-5dfc-4404-8642-49659190d41e
[2025-05-22T22:10:52.101Z] Removing errored webhost language worker channel for runtime: python workerId:99ec6883-5dfc-4404-8642-49659190d41e
[2025-05-22T22:10:52.102Z] Microsoft.Azure.WebJobs.Script.Grpc: The operation has timed out.
[2025-05-22T22:10:52.595Z] Traceback (most recent call last):
[2025-05-22T22:10:52.596Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\main.py", line 61, in main
[2025-05-22T22:10:52.597Z]     return asyncio.run(start_async(
[2025-05-22T22:10:52.599Z]            ^^^^^^^^^^^^^^^^^^^^^^^^
[2025-05-22T22:10:52.600Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
[2025-05-22T22:10:52.602Z]     return runner.run(main)
[2025-05-22T22:10:52.603Z]            ^^^^^^^^^^^^^^^^
[2025-05-22T22:10:52.605Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
[2025-05-22T22:10:52.606Z]     return self._loop.run_until_complete(task)
[2025-05-22T22:10:52.607Z]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-05-22T22:10:52.608Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
[2025-05-22T22:10:52.609Z]     return future.result()
[2025-05-22T22:10:52.611Z]            ^^^^^^^^^^^^^^^
[2025-05-22T22:10:52.612Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\main.py", line 71, in start_async
[2025-05-22T22:10:52.613Z]     from . import dispatcher
[2025-05-22T22:10:52.614Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 23, in <module>
[2025-05-22T22:10:52.615Z]     from . import bindings, constants, functions, loader, protos
[2025-05-22T22:10:52.616Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\loader.py", line 183, in <module>
[2025-05-22T22:10:52.618Z]     f'Sys Path: {sys.path}, Sys Module: {sys.modules},'
[2025-05-22T22:10:52.620Z]                                         ^^^^^^^^^^^^^
[2025-05-22T22:10:52.621Z]   File "<frozen importlib._bootstrap>", line 545, in _module_repr
[2025-05-22T22:10:52.622Z]   File "<frozen importlib._bootstrap>", line 830, in _module_repr_from_spec
[2025-05-22T22:10:52.623Z] AttributeError: '_SixMetaPathImporter' object has no attribute '_path'
[2025-05-22T22:10:52.624Z] Traceback (most recent call last):
[2025-05-22T22:10:52.625Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\main.py", line 61, in main
[2025-05-22T22:10:52.627Z]     return asyncio.run(start_async(
[2025-05-22T22:10:52.628Z]            ^^^^^^^^^^^^^^^^^^^^^^^^
[2025-05-22T22:10:52.629Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
[2025-05-22T22:10:52.630Z]     return runner.run(main)
[2025-05-22T22:10:52.631Z]            ^^^^^^^^^^^^^^^^
[2025-05-22T22:10:52.632Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
[2025-05-22T22:10:52.635Z]     return self._loop.run_until_complete(task)
[2025-05-22T22:10:52.636Z]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-05-22T22:10:52.638Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
[2025-05-22T22:10:52.639Z]     return future.result()
[2025-05-22T22:10:52.640Z]            ^^^^^^^^^^^^^^^
[2025-05-22T22:10:52.641Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\main.py", line 71, in start_async
[2025-05-22T22:10:52.642Z]     from . import dispatcher
[2025-05-22T22:10:52.643Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 23, in <module>
[2025-05-22T22:10:52.644Z]     from . import bindings, constants, functions, loader, protos
[2025-05-22T22:10:52.645Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\loader.py", line 183, in <module>
[2025-05-22T22:10:52.646Z]     f'Sys Path: {sys.path}, Sys Module: {sys.modules},'
[2025-05-22T22:10:52.647Z]                                         ^^^^^^^^^^^^^
[2025-05-22T22:10:52.648Z]   File "<frozen importlib._bootstrap>", line 545, in _module_repr
[2025-05-22T22:10:52.649Z]   File "<frozen importlib._bootstrap>", line 830, in _module_repr_from_spec
[2025-05-22T22:10:52.650Z] AttributeError: '_SixMetaPathImporter' object has no attribute '_path'
[2025-05-22T22:10:52.652Z] Traceback (most recent call last):
[2025-05-22T22:10:52.653Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12/WINDOWS/X64/worker.py", line 68, in <module>
[2025-05-22T22:10:52.654Z]     main.main()
[2025-05-22T22:10:52.656Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\main.py", line 61, in main
[2025-05-22T22:10:52.657Z]     return asyncio.run(start_async(
[2025-05-22T22:10:52.659Z]            ^^^^^^^^^^^^^^^^^^^^^^^^
[2025-05-22T22:10:52.660Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
[2025-05-22T22:10:52.662Z]     return runner.run(main)
[2025-05-22T22:10:52.664Z]            ^^^^^^^^^^^^^^^^
[2025-05-22T22:10:52.665Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
[2025-05-22T22:10:52.667Z]     return self._loop.run_until_complete(task)
[2025-05-22T22:10:52.668Z]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-05-22T22:10:52.670Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
[2025-05-22T22:10:52.671Z]     return future.result()
[2025-05-22T22:10:52.672Z]            ^^^^^^^^^^^^^^^
[2025-05-22T22:10:52.673Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\main.py", line 71, in start_async
[2025-05-22T22:10:52.674Z]     from . import dispatcher
[2025-05-22T22:10:52.675Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 23, in <module>
[2025-05-22T22:10:52.676Z]     from . import bindings, constants, functions, loader, protos
[2025-05-22T22:10:52.677Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\loader.py", line 183, in <module>
[2025-05-22T22:10:52.678Z]     f'Sys Path: {sys.path}, Sys Module: {sys.modules},'
[2025-05-22T22:10:52.679Z]                                         ^^^^^^^^^^^^^
[2025-05-22T22:10:52.680Z]   File "<frozen importlib._bootstrap>", line 545, in _module_repr
[2025-05-22T22:10:52.681Z]   File "<frozen importlib._bootstrap>", line 830, in _module_repr_from_spec
[2025-05-22T22:10:52.683Z] AttributeError: '_SixMetaPathImporter' object has no attribute '_path'
[2025-05-22T22:10:53.717Z]  ERROR: unhandled error in functions worker: '_SixMetaPathImporter' object has no attribute '_path'
[2025-05-22T22:10:53.720Z] Traceback (most recent call last):
[2025-05-22T22:10:53.722Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\main.py", line 61, in main
[2025-05-22T22:10:53.724Z]     return asyncio.run(start_async(
[2025-05-22T22:10:53.725Z]            ^^^^^^^^^^^^^^^^^^^^^^^^
[2025-05-22T22:10:53.726Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
[2025-05-22T22:10:53.727Z]     return runner.run(main)
[2025-05-22T22:10:53.727Z]            ^^^^^^^^^^^^^^^^
[2025-05-22T22:10:53.728Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
[2025-05-22T22:10:53.729Z]     return self._loop.run_until_complete(task)
[2025-05-22T22:10:53.730Z]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-05-22T22:10:53.731Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
[2025-05-22T22:10:53.731Z]     return future.result()
[2025-05-22T22:10:53.733Z]            ^^^^^^^^^^^^^^^
[2025-05-22T22:10:53.736Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\main.py", line 71, in start_async
[2025-05-22T22:10:53.738Z]     from . import dispatcher
[2025-05-22T22:10:53.738Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 23, in <module>
[2025-05-22T22:10:53.739Z]     from . import bindings, constants, functions, loader, protos
[2025-05-22T22:10:53.740Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\loader.py", line 183, in <module>
[2025-05-22T22:10:53.741Z]     f'Sys Path: {sys.path}, Sys Module: {sys.modules},'
[2025-05-22T22:10:53.742Z]                                         ^^^^^^^^^^^^^
[2025-05-22T22:10:53.743Z]   File "<frozen importlib._bootstrap>", line 545, in _module_repr
[2025-05-22T22:10:53.743Z]   File "<frozen importlib._bootstrap>", line 830, in _module_repr_from_spec
[2025-05-22T22:10:53.744Z] AttributeError: '_SixMetaPathImporter' object has no attribute '_path'
[2025-05-22T22:10:53.745Z] Traceback (most recent call last):
[2025-05-22T22:10:53.746Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\main.py", line 61, in main
[2025-05-22T22:10:53.747Z]     return asyncio.run(start_async(
[2025-05-22T22:10:53.748Z]            ^^^^^^^^^^^^^^^^^^^^^^^^
[2025-05-22T22:10:53.748Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
[2025-05-22T22:10:53.750Z]     return runner.run(main)
[2025-05-22T22:10:53.751Z]            ^^^^^^^^^^^^^^^^
[2025-05-22T22:10:53.753Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
[2025-05-22T22:10:53.755Z]     return self._loop.run_until_complete(task)
[2025-05-22T22:10:53.756Z]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-05-22T22:10:53.757Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
[2025-05-22T22:10:53.758Z]     return future.result()
[2025-05-22T22:10:53.759Z]            ^^^^^^^^^^^^^^^
[2025-05-22T22:10:53.760Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\main.py", line 71, in start_async
[2025-05-22T22:10:53.761Z]     from . import dispatcher
[2025-05-22T22:10:53.762Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 23, in <module>
[2025-05-22T22:10:53.764Z]     from . import bindings, constants, functions, loader, protos
[2025-05-22T22:10:53.765Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\loader.py", line 183, in <module>
[2025-05-22T22:10:53.769Z]     f'Sys Path: {sys.path}, Sys Module: {sys.modules},'
[2025-05-22T22:10:53.771Z]                                         ^^^^^^^^^^^^^
[2025-05-22T22:10:53.773Z]   File "<frozen importlib._bootstrap>", line 545, in _module_repr
[2025-05-22T22:10:53.773Z] Language Worker Process exited. Pid=14332.
[2025-05-22T22:10:53.774Z]   File "<frozen importlib._bootstrap>", line 830, in _module_repr_from_spec
[2025-05-22T22:10:53.775Z] py exited with code 1 (0x1). AttributeError: '_SixMetaPathImporter' object has no attribute '_path',AttributeError: '_SixMetaPathImporter' object has no attribute '_path',AttributeError: '_SixMetaPathImporter' object has no attribute '_path'.
[2025-05-22T22:10:53.776Z] AttributeError: '_SixMetaPathImporter' object has no attribute '_path'
[2025-05-22T22:10:53.778Z] Traceback (most recent call last):
[2025-05-22T22:10:53.779Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12/WINDOWS/X64/worker.py", line 68, in <module>
[2025-05-22T22:10:53.780Z]     main.main()
[2025-05-22T22:10:53.781Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\main.py", line 61, in main
[2025-05-22T22:10:53.782Z]     return asyncio.run(start_async(
[2025-05-22T22:10:53.784Z]            ^^^^^^^^^^^^^^^^^^^^^^^^
[2025-05-22T22:10:53.786Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
[2025-05-22T22:10:53.788Z]     return runner.run(main)
[2025-05-22T22:10:53.790Z]            ^^^^^^^^^^^^^^^^
[2025-05-22T22:10:53.791Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
[2025-05-22T22:10:53.792Z] Exceeded language worker restart retry count for runtime:python. Shutting down and proactively recycling the Functions Host to recover
[2025-05-22T22:10:53.792Z]     return self._loop.run_until_complete(task)
[2025-05-22T22:10:53.794Z]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-05-22T22:10:53.795Z]   File "C:\<PATH>AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
[2025-05-22T22:10:53.796Z]     return future.result()
[2025-05-22T22:10:53.797Z]            ^^^^^^^^^^^^^^^
[2025-05-22T22:10:53.798Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\main.py", line 71, in start_async
[2025-05-22T22:10:53.799Z]     from . import dispatcher
[2025-05-22T22:10:53.801Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 23, in <module>
[2025-05-22T22:10:53.802Z]     from . import bindings, constants, functions, loader, protos
[2025-05-22T22:10:53.804Z]   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.12\WINDOWS\X64\azure_functions_worker\loader.py", line 183, in <module>
[2025-05-22T22:10:53.805Z]     f'Sys Path: {sys.path}, Sys Module: {sys.modules},'
[2025-05-22T22:10:53.805Z]                                         ^^^^^^^^^^^^^
[2025-05-22T22:10:53.806Z]   File "<frozen importlib._bootstrap>", line 545, in _module_repr
[2025-05-22T22:10:53.807Z]   File "<frozen importlib._bootstrap>", line 830, in _module_repr_from_spec

Steps to reproduce

install python 3.12 on windows using local installation (no admin privilegs)

install latest func tools 4.0.7030 , using dotnet sdk 8.0

try and run

@es-cs1
Copy link
Author

es-cs1 commented May 22, 2025

I downgraded from python 3.12.0 to python 3.11.9 and it worked

found from a comment inside this issue...
https://stackoverflow.com/questions/79297463/running-an-azure-function-locally-results-in-a-worker-error

@akozhikkot
Copy link

We can not use Python 3.11 due to issues with Cryptography module and the ADO build agent versions.

Is development on 3.12 not supported yet, looks like the 3.12 support is in GA on Azure Functions now

@akozhikkot
Copy link

An update on this, using the latest python 3.12 version seems to start up the functions correctly . 3.12.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants