Miserlou / Zappa

Serverless Python
https://blog.zappa.io/
MIT License
11.89k stars 1.2k forks source link

xgboost error after zappa deploy #1487

Open umernawaz0301 opened 6 years ago

umernawaz0301 commented 6 years ago

Cannot find XGBoost Library in the candidate path, did you install compilers and run build.sh in root path? List of candidates: /tmp/zappa-py-3-ml/xgboost/libxgboost.so /tmp/zappa-py-3-ml/xgboost/../../lib/libxgboost.so /tmp/zappa-py-3-ml/xgboost/./lib/libxgboost.so /var/lang/xgboost/libxgboost.so

in local environment running perfect but giving error after deploying to aws can anyone answer why this error occurred and how to resolve this..

thanks in advance.

oegesam commented 5 years ago

Did you figure this one out? Running into the same problem...

maazulhaque commented 5 years ago

I am encountering the same issue, can anyone shed some light on this?

mdanish0320 commented 5 years ago

we have resolved the issue by downloading and install xgboost in AWS environment i.e EC2. Then copy xgboost and paste it to your laptop or development environment in site-packages inside your virtual env. Then run zappa deploy or zappa update.

oegesam commented 5 years ago

Can also build it in a docker with a Dockerfile like:

FROM lambci/lambda:build

RUN git clone --recursive https://github.com/dmlc/xgboost
RUN cd xgboost; make -j4

and then copy the libxgboost.so file from the docker:

docker cp lambda_xgboost:/var/task/xgboost/lib/libxgboost.so .

then copy it to your zappa deployment directory (I put it in a /lib subdirectory) and then add to your zappa_settings.json "include": ["lib/libxgboost.so"]

maazulhaque commented 5 years ago

Thanks for the help. I used the docker container to copy the so file but the zappa_settings.json "include": ["lib/libxgboost.so"] method didnt work for me. Had to put it under xgboost folder inside sitepackages.