Hi everyone, I'm copying my post over from Stack Overflow to see if anyone has some ideas here. This is my first time using Azure functions so I apologize if this is a noob question. My organization already set up everything for Azure in our repository, but now I'm attempting to run the functions locally on my Windows machine, which gives me a ton of ModuleNotFoundErrors. Here are the steps I'm taking to start the localhost:
> python -m venv .venv
> .venv\Scripts\activate
> pip install -r requirements.txt
> func start --python
I'm running my terminal as an administrator, and when I run pip install -r requirements.txt
it says that all requirements are already satisfied. However, when I func start
it returns a spew of ModuleNotFoundErrors, such as:
[2024-08-02T10:13:40.452Z] Result: Failure
Exception: ModuleNotFoundError: No module named 'azure.durable_functions'. Cannot find module. Please check the requirements.txt file for the missing module. For more info, please refer the troubleshooting guide: https://aka.ms/functions-modulenotfound. Current sys.path: ['C:\\ProgramData\\chocolatey\\lib\\azure-functions-core-tools\\tools\\workers\\python\\3.10\\WINDOWS\\X64', 'C:\\ProgramData\\chocolatey\\lib\\azure-functions-core-tools\\tools\\workers\\python\\3.10\\WINDOWS\\X64', 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\\python310.zip', 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\\DLLs', 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\\lib', 'C:\\Users\\spayk\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0', 'C:\\Users\\spayk\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\site-packages', 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0', 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\\lib\\site-packages', 'C:\\Users\\spayk\\project']
(This is just one example of a ModuleNotFound error out of many, the terminal gives me so many errors that it actually takes up the whole history of the shell, even if I scroll all the way back up to the top.)
This doesn't make sense to me since when I ran the pip install
previously it returned Requirement already satisfied: azure-functions-durable==1.2.9 in c:\users\spayk\project\.venv\lib\site-packages (from -r requirements.txt (line 5)) (1.2.9)
. Additionally, when I look inside my .venv\Lib folder I can see the site packages installed there.
I've tried multiple ideas for fixing this issue, including even running an Ubuntu WSL so I can use tools like Homebrew and source commands. I think the problem might be with the paths leading towards the installs, but I'm not really sure how I could redirect those. For reference, everyone else in my organization develops on Mac, I'm the only Windows developer, so modifying the code base in a way that would mess up the Azure functionality on a MacOS environment isn't an option for me.
If anyone else has experienced something similar please let me know, and thanks in advance!