No module named 'xgboost'

I want to import the xgboost module, but there’s an error: No module named ‘xgboost’. The module is installed. How can I solve the problem? Is there a possibility to import xgboost in Rasa?

Trace: ** File “/usr/local/lib/python3.8/site-packages/rasa_sdk/executor.py”, line 262, in register_package self._import_submodules(package) File “/usr/local/lib/python3.8/site-packages/rasa_sdk/executor.py”, line 225, in _import_submodules self._import_module(full_name) File “/usr/local/lib/python3.8/site-packages/rasa_sdk/executor.py”, line 239, in _import_module module = importlib.import_module(name) File “/usr/local/Cellar/python@3.8/3.8.15/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/init.py”, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File “”, line 1014, in _gcd_import File “”, line 991, in _find_and_load File “”, line 975, in _find_and_load_unlocked File “”, line 671, in _load_unlocked File “”, line 843, in exec_module File “”, line 219, in _call_with_frames_removed File “actions/actions.py”, line 19, in import xgboost as xg **

I appreciate the information and advice you have shared. I will try to figure it out for more.

1 Like

Oh, I found the reason. Xgboost was installed using the wrong version of python (3.7 instead of 3.8).