skip to Main Content

i have a problem with module xgboost.sklearn.

I have a project developed with visual studio code (+ azure extensions). I write in python. I need to import xgboost.sklearn so i add this to requirements.txt:

azure-functions
azure-cosmos

pybind11
scipy==1.5.4

pyyaml==6.0
numpy==1.19.5
pandas==1.1.5
scikit-learn==0.24.2
xgboost==0.80

I run it locally (F5 – start debugging). Everything works just fine. So i deployed functions and call my endpoint. I got 500:
Result: Failure Exception: ModuleNotFoundError: No module named ‘xgboost.sklearn’ Stack:…….
(line with import xgboost.sklearn)

I try pip freeze > requirements.txt – not working
I have "azureFunctions.scmDoBuildDuringDeployment": true in settings.json
My resources on Azure contains xgboost and sklearn (.python_packages/lib/site-packages): enter image description here

How can i fix it?

2

Answers


  1. Try using hit and trail on multiple versions of scikit-learn to install and see what works.

    Login or Signup to reply.
  2. After reproducing from my end, When I tried deploying with manually given requirements.txt I have received the similar issue. This is working fine after following the below steps.

    Step1: Installed the scikit-learn and xgboost locally and then generated rerequirements.txt file using pip freeze > requirements.txt.

    enter image description here

    Step2: Now deployed the function to Function App

    enter image description here

    Then I have tested my function App which executed successfully.

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search