AxeldeRomblay / MLBox

MLBox is a powerful Automated Machine Learning python library.
https://mlbox.readthedocs.io/en/latest/
Other
1.49k stars 274 forks source link

pytest fails with OSError: dlopen: cannot load any more object with static TLS #74

Open jimthompson5802 opened 4 years ago

jimthompson5802 commented 4 years ago

OS: MacOS 10.14.6 Docker for Mac: 2.1.01 docker base image: continuumio/minconda3:4.3.27 mlbox: 0.8.0 Python: 3.6

pytest unit tests fail with error OSError: dlopen: cannot load any more object with static TLS. This contains full error log mlbox_pytest_failure_static_tls_py36.txt

In researching this issue, found this posting. The dlopen error in this posting was solved by changing the order of imports. From this, I changed the oder of imports in mlbox/model/classification/classifier.py for 'lightgbm'. See this screenshot for the change of import order, i.e., import lightgbm before the sklearn imports.

Screen Shot 2019-08-10 at 10 21 19

With this change, the all the unit test cases pass. Here is the pytest run log after changing import order. mlbox_pytest_run_afer_import_change.txt

I'll submit a PR to address this issue.

For reference, this is the Dockerfile used for this test.

FROM continuumio/miniconda3:4.3.27

# 
# install additional packages
#
RUN pip install mlflow mlbox

WORKDIR /opt/project
ENV MLFLOW_TRACKING_URI /opt/project/tracking