Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Python package looks for library in wrong path #5106

@david-cortes

Description

@david-cortes

Trying to build the python package from source without installing it will somehow try to pick the wrong path for system libraries. I get an error about being unable to import scipy.sparse, even though I can import that library in the same session (this is after successfully building lib_lightgbm through the cmake system):

>>> import scipy.sparse
>>> import lightgbm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/david/del/py_lightgbm/python-package/lightgbm/__init__.py", line 8, in <module>
    from .basic import Booster, Dataset, Sequence, register_logger
  File "/home/david/del/py_lightgbm/python-package/lightgbm/basic.py", line 126, in <module>
    _LIB = _load_lib()
  File "/home/david/del/py_lightgbm/python-package/lightgbm/basic.py", line 117, in _load_lib
    lib = ctypes.cdll.LoadLibrary(lib_path[0])
  File "/home/david/anaconda3/envs/py3/lib/python3.9/ctypes/__init__.py", line 460, in LoadLibrary
    return self._dlltype(name)
  File "/home/david/anaconda3/envs/py3/lib/python3.9/ctypes/__init__.py", line 382, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/david/anaconda3/envs/py3/lib/python3.9/site-packages/scipy/sparse/../../../../libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/david/del/py_lightgbm/lib_lightgbm.so)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions