0

我正在尝试运行 python 文件并收到此错误,我尝试查找但找不到解决方案。

在此处输入图像描述

OSError: dlopen(/opt/anaconda3/lib/python3.7/site-packages/lightgbm/lib_lightgbm.so, 6): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib Referenced from: /opt/anaconda3/lib/python3.7/site-packages/lightgbm/lib_lightgbm.so Reason: image not found
Traceback:
File "/opt/anaconda3/lib/python3.7/site-packages/streamlit/ScriptRunner.py", line 319, in _run_script
    exec(code, module.__dict__)
File "/Users/prithvi/Desktop/NEW/app.py", line 6, in <module>
    model = load_model("deployment_28042020")
File "/opt/anaconda3/lib/python3.7/site-packages/pycaret/regression.py", line 6425, in load_model
    return joblib.load(model_name)
File "/opt/anaconda3/lib/python3.7/site-packages/joblib/numpy_pickle.py", line 585, in load
    obj = _unpickle(fobj, filename, mmap_mode)
File "/opt/anaconda3/lib/python3.7/site-packages/joblib/numpy_pickle.py", line 504, in _unpickle
    obj = unpickler.load()
File "/opt/anaconda3/lib/python3.7/pickle.py", line 1088, in load
    dispatch[key[0]](self)
File "/opt/anaconda3/lib/python3.7/pickle.py", line 1376, in load_global
    klass = self.find_class(module, name)
File "/opt/anaconda3/lib/python3.7/pickle.py", line 1426, in find_class
    __import__(module, level=0)
File "/opt/anaconda3/lib/python3.7/site-packages/pycaret/preprocess.py", line 33, in <module>
    from lightgbm import LGBMClassifier as lgbmc
File "/opt/anaconda3/lib/python3.7/site-packages/lightgbm/__init__.py", line 8, in <module>
    from .basic import Booster, Dataset
File "/opt/anaconda3/lib/python3.7/site-packages/lightgbm/basic.py", line 33, in <module>
    _LIB = _load_lib()
File "/opt/anaconda3/lib/python3.7/site-packages/lightgbm/basic.py", line 28, in _load_lib
    lib = ctypes.cdll.LoadLibrary(lib_path[0])
File "/opt/anaconda3/lib/python3.7/ctypes/__init__.py", line 442, in LoadLibrary
    return self._dlltype(name)
File "/opt/anaconda3/lib/python3.7/ctypes/__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
4

1 回答 1

0

你能更新libgomp1:

apt-get install -y libgomp1

如果在 Docker Image 上运行,请将其包含在 Dockerfile 中:

运行 apt-get update && apt-get install -y libgomp1

于 2020-08-04T03:41:54.740 回答