Testing 11.4, quarterly and latest pkgs(py37-xgboost 1.0.2 and 1.1.1): ==================== 8< ======================= 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 11, in <module> from .core import DMatrix, DeviceQuantileDMatrix, Booster File "/usr/local/lib/python3.7/site-packages/xgboost/core.py", line 175, in <module> _LIB = _load_lib() File "/usr/local/lib/python3.7/site-packages/xgboost/core.py", line 134, in _load_lib lib_paths = find_lib_path() File "/usr/local/lib/python3.7/site-packages/xgboost/libpath.py", line 45, in find_lib_path dll_path = [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 = [os.path.join(p, 'libxgboost.so') for p in dll_path] File "/usr/local/lib/python3.7/posixpath.py", line 80, in join a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType ==================== 8< ======================= I used to solve it like this: ==================== 8< ======================= --- 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 = [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 == 'win32': if platform.architecture()[0] == '64bit': dll_path.append(os.path.join(curr_path, '../../windows/x64/Release/')) ==================== 8< =======================
This appears to be a bug with the upstream code. Added the upstream bug report.
nomoo, Thank you for submitting the bug report. The correct location to submit bugs in the projects themselves is their bug reporting systems, in this case - a GitHub issues page. Yuri
The fix is included in the update to 1.2.1
A commit references this bug: Author: yuri Date: Mon Oct 26 21:38:06 UTC 2020 New revision: 553389 URL: https://svnweb.freebsd.org/changeset/ports/553389 Log: misc/py-xgboost: Update 1.2.0 -> 1.2.1 PR: 247408 MFH: 2020Q4 (fixes py-xgboost failure, see bug#247408) Changes: head/misc/py-xgboost/Makefile head/misc/py-xgboost/distinfo head/misc/py-xgboost/files/patch-CMakeLists.txt head/misc/py-xgboost/files/patch-xgboost_libpath.py
A commit references this bug: Author: yuri Date: Tue Oct 27 01:45:31 UTC 2020 New revision: 553406 URL: https://svnweb.freebsd.org/changeset/ports/553406 Log: MFH: r552175 r553388 r553389 Now builds on FreeBSD-12 powerpc64. As a test, also enable on FreeBSD-13 powerpc64. Approved by: portmgr (tier-2 blanket) misc/xgboost: Update 1.2.0 -> 1.2.1 misc/py-xgboost: Update 1.2.0 -> 1.2.1 PR: 247408 Approved by: ports-secteam (fluffy) Changes: _U branches/2020Q4/ branches/2020Q4/misc/py-xgboost/Makefile branches/2020Q4/misc/py-xgboost/distinfo branches/2020Q4/misc/py-xgboost/files/patch-CMakeLists.txt branches/2020Q4/misc/py-xgboost/files/patch-xgboost_libpath.py branches/2020Q4/misc/xgboost/Makefile branches/2020Q4/misc/xgboost/distinfo