Alexander Chinyan
Alexander Chinyan

Reputation: 211

Azure ImportError: Unable to import required dependencies: numpy

I've build a Function in Azure and deployed it via VS. The function is running locally well, the build process when uploaded to the cloud is successfull but when it's trying to run (with the blob trigger) I get the next error:

ImportError: Unable to import required dependencies: numpy

I'm using pandas library that needs numpy. I downloaded all of the packeges and dependencies,I've tried to uninstall and install again ,I even tried to upgrade every library especially numpy, nothing.

The function is written in Python 3.7.5 and running on Linux env(Azure runtime).

my imports:

import logging
import openpyxl
import pymysql
import pymysql.cursors
import pandas as pd
import xlrd
import re 
from itertools import islice
import azure.functions as func

Upvotes: 0

Views: 1063

Answers (2)

tubakaya
tubakaya

Reputation: 497

Please check if your deployed azure function content is correct. You can do that with App Service Editor in the portal.

enter image description here

Upvotes: 0

Ankit Kumar
Ankit Kumar

Reputation: 508

You need to have all your dependencies in requirements.txt before you publish. This way (using the new tools), after publish all your application dependencies will be downloaded for you as part of your function app content. In this case, please make sure you have pandas, numpy or whatever is required by your application in the requirements.txt file.

Here's more information on how to publish and what to expect -- https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python#publishing-to-azure

Upvotes: 1

Related Questions