Share via

"func start" in vs code terminal for azure function returning "ERROR: unhandled error in functions worker: '_SixMetaPathImporter' object has no attribute '_path' "

Stephane Ducrepin 20 Reputation points
2026-03-24T18:35:20.5933333+00:00

I am connected to an azure function on VS Code 2022 with Python 3.12 on Windows 11. I have the latest version of Azure Functions Core Tools installed, 4.8.0. When I try to run "func start --verbose" it doesn't compile. Instead I get this error:

[2026-03-24T18:21:53.150Z]  ERROR: unhandled error in functions worker: '_SixMetaPathImporter' object has no attribute '_path'
[2026-03-24T18:21:53.192Z] Failed to start language worker process for runtime: python. workerId:49808b95-0efa-4749-9410-a5c3b8d15c68
[2026-03-24T18:21:53.192Z] Language Worker Process exited. Pid=25976.
[2026-03-24T18:21:53.196Z] Microsoft.Azure.WebJobs.Script.Grpc: 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'.
[2026-03-24T18:21:53.196Z] Removing errored webhost language worker channel for runtime: python workerId:
[2026-03-24T18:21:53.198Z] Microsoft.Azure.WebJobs.Script.Grpc: 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'.
[2026-03-24T18:21:53.201Z] Error building configuration in an external startup class.
[2026-03-24T18:21:53.202Z] Error building configuration in an external startup class. System.Private.CoreLib: One or more errors occurred. (py exited with code 1 (0x1)). Microsoft.Azure.WebJobs.Script.Grpc: 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'.
[2026-03-24T18:21:53.205Z] A host error has occurred during startup operation '
[2026-03-24T18:21:53.206Z] Microsoft.Azure.WebJobs.Script: Error building configuration in an external startup class. System.Private.CoreLib: One or more errors occurred. (py exited with code 1 (0x1)). Microsoft.Azure.WebJobs.Script.Grpc: 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'.       
Value cannot be null. (Parameter 'provider')
[2026-03-24T18:21:53.282Z] Host startup operation has been canceled

I have made sure that my azure function is using the same runtime stack language as my computer, Python 3.12. I'm struggling to find what the issue could be. Any help would be greatly appreciated!

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


Answer accepted by question author

Pravallika KV 16,605 Reputation points Microsoft External Staff Moderator
2026-03-25T20:55:25.63+00:00

Hi @Stephane Ducrepin ,

Thanks for the confirmation. Glad the issue is resolved.

Solution:

Downgrading the Python version from 3.12 to 3.11 solved the issue.

Installed python 3.11 and used that instead with azure core tools 4.7, and it worked!

Hope this helps!


If the resolution was helpful, kindly take a moment to click on User's imageand click on Yes for was this answer helpful. And, if you have any further query do let us know.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. AI answer

    2026-03-24T18:35:36.3433333+00:00

    Azure Functions currently supports specific Python versions (for example 3.6–3.9 in the provided documentation), and the tooling and worker runtime are built and tested against those versions. Running the Functions Python worker with an unsupported interpreter such as Python 3.12 can cause the worker process to crash with import‑related errors like the '_SixMetaPathImporter' object has no attribute '_path' failure shown in the log.

    To resolve the issue, align the local Python version with a Functions‑supported version and ensure dependencies are built in that environment:

    1. Install a supported Python version (for example, one of the versions listed as supported for the Functions runtime in the Azure portal for the target app).
    2. Configure the Azure Functions Core Tools and VS Code to use that Python interpreter for the function app.
    3. Recreate or reinstall the virtual environment and dependencies using the supported Python version so that packages and wheels match the expected runtime:
      • Delete any existing .python_packages or virtual environment folders for the project.
      • Reinstall dependencies with the supported Python version.
    4. Run the Functions host again with:
         func start --verbose
      

    If ModuleNotFoundError or wheel compatibility issues appear after switching Python versions, use the documented guidance to verify that:

    • The installed wheel tags include linux for deployment to Azure (when building for Linux consumption plans).
    • The package classifiers in METADATA include the supported Python versions.
    • Incompatible or obsolete packages are updated or replaced.

    If dependency isolation causes conflicts, set the PYTHON_ISOLATE_WORKER_DEPENDENCIES application setting to 0 as described in the troubleshooting guidance.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.