2

After successfully pip installing xgboost, when running:

import xgboost as xgb

I am getting the following error:

xgboost.core.XGBoostError: XGBoost Library (libxgboost.dylib) could not be loaded.
Likely causes:
  * OpenMP runtime is not installed (vcomp140.dll or libgomp-1.dll for Windows, libgomp.so for UNIX-like OSes)
  * You are running 32-bit Python on a 64-bit OS

As stated in this other question here I am running 64-bit Python since this:

import sys
print(sys.maxsize > 2**32)

returns True

Finally, to install OpenMP I tried this: brew install libomp but the problem persists.

PD. I am running Catalina 10.15.1

prp
  • 914
  • 1
  • 9
  • 24

1 Answers1

1

I had the same problem. Tried to fix both "likely" causes to no avail. Strangely, everything was working absolutely fine just a few days ago. I changed the Python version from 3.6.1 to 3.6.7 and it fixed the issue. Unfortunately, I don't yet know what the problem was, but it fixed the issue for me.

This is Python's docker image on CircleCi's linux machine. Specifying this in case the problem has to do anything with it.