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!