[python-package] modify libpath.py and fix typos (#1594)

* Update Makefile

* Update Makefile

* modify __init__.py

* modified libpath.py and fixed typos
This commit is contained in:
chanis 2016-09-22 01:12:19 +08:00 committed by Tianqi Chen
parent 9f8116416b
commit 62830be29d

View File

@ -12,7 +12,7 @@ class XGBoostLibraryNotFound(Exception):
def find_lib_path(): def find_lib_path():
"""Load find the path to xgboost dynamic library files. """Find the path to xgboost dynamic library files.
Returns Returns
------- -------
@ -33,16 +33,15 @@ def find_lib_path():
dll_path.append(os.path.join(curr_path, '../../windows/Release/')) dll_path.append(os.path.join(curr_path, '../../windows/Release/'))
# hack for pip installation when copy all parent source directory here # hack for pip installation when copy all parent source directory here
dll_path.append(os.path.join(curr_path, './windows/Release/')) dll_path.append(os.path.join(curr_path, './windows/Release/'))
if os.name == 'nt':
dll_path = [os.path.join(p, 'libxgboost.dll') for p in dll_path] dll_path = [os.path.join(p, 'libxgboost.dll') for p in dll_path]
else: else:
dll_path = [os.path.join(p, 'libxgboost.so') for p in dll_path] dll_path = [os.path.join(p, 'libxgboost.so') for p in dll_path]
lib_path = [p for p in dll_path if os.path.exists(p) and os.path.isfile(p)] lib_path = [p for p in dll_path if os.path.exists(p) and os.path.isfile(p)]
# From github issues, most of installation errors come from machines w/o compilers # From github issues, most of installation errors come from machines w/o compilers
if len(lib_path) == 0 and not os.environ.get('XGBOOST_BUILD_DOC', False): if not lib_path and not os.environ.get('XGBOOST_BUILD_DOC', False):
raise XGBoostLibraryNotFound( raise XGBoostLibraryNotFound(
'Cannot find XGBoost Libarary in the candidate path, ' + 'Cannot find XGBoost Library in the candidate path, ' +
'did you install compilers and run build.sh in root path?\n' 'did you install compilers and run build.sh in root path?\n'
'List of candidates:\n' + ('\n'.join(dll_path))) 'List of candidates:\n' + ('\n'.join(dll_path)))
return lib_path return lib_path