0

was deploying prophet code to azure functions and faced this error, the code is working perfectly fine in my local mac but when i try to deploy it on the cloud. i get this error.

my requirements.txt is:

requests,pandas,numpy,cython,pystan==2.19.1.1,joblib,click,prophet==1.0.1,cmdstanpy==0.9.68,plotly,matplotlib

i am using python version = 3.8 this is the same python version as in my localsystem. i also selected python version 3.8 when creating the azure function.

and have ordered the requirements in the same order as when i installed them in my local environment.

enter image description here

thank you

1 Answers1

0

ModuleNotFoundError: No module named 'numpy when deploying prophet code on azure functions

  1. Not Sure that you have kept all the libraries separated with comma (,) for better view in the Question but in requirements.txt file, write all libraries in new lines like below:

enter image description here

And I have faced issues when mentioning the version numbers of the packages in requirements.txt file such as versioning will install specific packages and without versioning will install the latest versioned, most of the times worked without mentioning version numbers. If your python version and code is compatible only with the specific version of packages, then use versions in requirements.txt file.

  1. Activate the Virtual Environment if not done with the remotesigned policy in the project terminal of the VS Code:
Set-executionpolicy remotesigned
.venv\Scripts\Activate.ps1\
  1. As @RB17 mentioned here that even the requirements.txt file is included, it fails if folder structure is not correct.
  • hey thanks for replying, but i had done the same thing as you have mentioned here. I had mentioned the correct library versions and the same versions i have used to install on my local system and it worked here but while deploying i face this error.I have deployed many different models on azure functions but while deploying the prophet model i face this numpy error. have also tried mentioning numpy in the requirements file and tried without it too, but got the same error. – hawkingradiation Nov 04 '22 at 13:48