Date: Fri, 19 Jun 2020 09:14:37 +0000 From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 247408] misc/py-xgboost: python can't import xgboost.so Message-ID: <bug-247408-7788@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D247408 Bug ID: 247408 Summary: misc/py-xgboost: python can't import xgboost.so Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: yuri@freebsd.org Reporter: nomoo@nomoo.ru Flags: maintainer-feedback?(yuri@freebsd.org) Assignee: yuri@freebsd.org Testing 11.4, quarterly and latest pkgs(py37-xgboost 1.0.2 and 1.1.1): =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 8< =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D python3.7 Python 3.7.7 (default, Jun 16 2020, 01:12:14) [Clang 8.0.0 (tags/RELEASE_800/final 356365)] on freebsd11 Type "help", "copyright", "credits" or "license" for more information. >>> import xgboost Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.7/site-packages/xgboost/__init__.py", line 1= 1, in <module> from .core import DMatrix, DeviceQuantileDMatrix, Booster File "/usr/local/lib/python3.7/site-packages/xgboost/core.py", line 175, = in <module> _LIB =3D _load_lib() File "/usr/local/lib/python3.7/site-packages/xgboost/core.py", line 134, = in _load_lib lib_paths =3D find_lib_path() File "/usr/local/lib/python3.7/site-packages/xgboost/libpath.py", line 45= , in find_lib_path dll_path =3D [os.path.join(p, 'libxgboost.so') for p in dll_path] File "/usr/local/lib/python3.7/site-packages/xgboost/libpath.py", line 45= , in <listcomp> dll_path =3D [os.path.join(p, 'libxgboost.so') for p in dll_path] File "/usr/local/lib/python3.7/posixpath.py", line 80, in join a =3D os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 8< =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D I used to solve it like this: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 8< =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- xgboost/libpath.py.orig 2020-03-02 05:10:11 UTC +++ xgboost/libpath.py @@ -4,6 +4,7 @@ import os import platform import sys +import sysconfig class XGBoostLibraryNotFound(Exception): @@ -22,7 +23,8 @@ def find_lib_path(): # make pythonpack hack: copy this directory one level upper for setup.= py dll_path =3D [curr_path, os.path.join(curr_path, '../../lib/'), os.path.join(curr_path, './lib/'), - os.path.join(sys.prefix, 'xgboost')] + os.path.join(sys.prefix, 'xgboost'), + sysconfig.get_config_var('LIBDIR')] if sys.platform =3D=3D 'win32': if platform.architecture()[0] =3D=3D '64bit': dll_path.append(os.path.join(curr_path, '../../windows/x64/Release/')) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 8< =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-247408-7788>