[azure functions][python] ModuleNotFoundError: No module named 'xgboost.sklearn'

k.ostrowski 0 Reputation points
2023-01-13T11:05:59.8166667+00:00

Hi, 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

How can i fix it?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,936 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,941 Reputation points Moderator
    2023-01-17T09:01:02.9466667+00:00

    @k.ostrowski Thanks for reaching out. As per the project description here for the version 0.80 pip installation may not work for Windows environments. I do see any limitation/issue with the latest version here.

    In case if any module or dependencies cannot be installed using pip then you need to use build native dependencies or enable remote build.
    You can refer to python troubleshooting document for more details.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.