question

DENZARLI-8506 avatar image
0 Votes"
DENZARLI-8506 asked SnehaAgrawal-MSFT commented

ModuleNotFoundError: No module named 'numpy' Error

I try to create a webjob. I can upload my python files but when I try to running azure gives "ModuleNotFoundError: No module named 'numpy'" error. How can I fix this?

azure-webapps
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Just checking in to see if the below answers helped. If this answers your query, do click “Accept Answer” and Up-Vote for the same. And, if you have any further query do let us know.

0 Votes 0 ·

1 Answer

SnehaAgrawal-MSFT avatar image
0 Votes"
SnehaAgrawal-MSFT answered

Thanks for asking question! If you see an error like ModuleNotFoundError: No module named 'example', this means that Python could not find one or more of your modules when the application started. This most often occurs if you deploy your virtual environment with your code.

Virtual environments are not portable, so a virtual environment should not be deployed with your application code. Instead, let Oryx create a virtual environment and install your packages on the web app by creating an app setting, SCM_DO_BUILD_DURING_DEPLOYMENT, and setting it to 1. This will force Oryx to install your packages whenever you deploy to App Service.

For more information, please see this article on virtual environment portability.

Also check this discussion might help here.

Let us know if further query or issue remains.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.