ku-cbd/PhageBoost

Installation issue on Mac systems due to xgboos from pip

Closed this issue · 1 comments

meren commented

Following the installation instrcutions in a new conda environment I got the following error with the command PhageBoost -h:

(PhageBoost-env) meren ~ $ PhageBoost -h
Traceback (most recent call last):
  File "/Users/meren/miniconda3/envs/PhageBoost-env/bin/PhageBoost", line 5, in <module>
    from PhageBoost.main import main
  File "/Users/meren/miniconda3/envs/PhageBoost-env/lib/python3.7/site-packages/PhageBoost/__init__.py", line 11, in <module>
    from PhageBoost import get_genecalls, get_predictions, get_matches, calc_features, main, bbcache
  File "/Users/meren/miniconda3/envs/PhageBoost-env/lib/python3.7/site-packages/PhageBoost/main.py", line 16, in <module>
    import xgboost as xgb
  File "/Users/meren/miniconda3/envs/PhageBoost-env/lib/python3.7/site-packages/xgboost/__init__.py", line 11, in <module>
    from .core import DMatrix, DeviceQuantileDMatrix, Booster
  File "/Users/meren/miniconda3/envs/PhageBoost-env/lib/python3.7/site-packages/xgboost/core.py", line 175, in <module>
    _LIB = _load_lib()
  File "/Users/meren/miniconda3/envs/PhageBoost-env/lib/python3.7/site-packages/xgboost/core.py", line 166, in _load_lib
    'Error message(s): {}\n'.format(os_error_list))
xgboost.core.XGBoostError: XGBoost Library (libxgboost.dylib) could not be loaded.
Likely causes:
  * OpenMP runtime is not installed (vcomp140.dll or libgomp-1.dll for Windows, libomp.dylib for Mac OSX, libgomp.so for Linux and other UNIX-like OSes). Mac OSX users: Run `brew install libomp` to install OpenMP runtime.
  * You are running 32-bit Python on a 64-bit OS
Error message(s): ['dlopen(/Users/meren/miniconda3/envs/PhageBoost-env/lib/python3.7/site-packages/xgboost/lib/libxgboost.dylib, 6): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib\n  Referenced from: /Users/meren/miniconda3/envs/PhageBoost-env/lib/python3.7/site-packages/xgboost/lib/libxgboost.dylib\n  Reason: image not found']

I could solve it by running the following two lines:

pip uninstall xgboost
conda install py-xgboost

And then, 🎉:

(PhageBoost-env) meren ~ $ PhageBoost -h
usage: %prog [options] file (or - for stdin)
 [-h] [-f FILES [FILES ...]]
                                              [-o OUTPUT] [-m MODEL]
                                              [-j N_JOBS]
                                              [-cs MIN_SIZE_OF_CONTIG]
                                              [-t THRESHOLD] [-l LENGTH]
                                              [-g GAPS] [-n  NEIGHBOURING]
                                              [-r  LOOK_FOR_REPEAT_FLAG]
                                              [-sr SEARCH_REGION] [-i INWARDS]
                                              [-att ATTSIZE] [-meta META]
                                              [-a  ALPHA]

optional arguments:
  -h, --help            show this help message and exit
  -f FILES [FILES ...], --file FILES [FILES ...]
  -o OUTPUT, --output OUTPUT
  -m MODEL, --model MODEL
  -j N_JOBS, --threads N_JOBS
  -cs MIN_SIZE_OF_CONTIG, --mincontigsize MIN_SIZE_OF_CONTIG
  -t THRESHOLD, --threshold THRESHOLD
  -l LENGTH, --length LENGTH
  -g GAPS, --gaps GAPS
  -n  NEIGHBOURING, --neighbouring NEIGHBOURING
  -r  LOOK_FOR_REPEAT_FLAG, --look_for_repeats LOOK_FOR_REPEAT_FLAG
  -sr SEARCH_REGION, --search-region SEARCH_REGION
  -i INWARDS, --inwards INWARDS
  -att ATTSIZE, --att-size ATTSIZE
  -meta META, --meta META
  -a  ALPHA, --alpha ALPHA

    Example of usage:
    PhageBoost -f example/data/NC_000907.fasta.gz -o results

FYI.

Thanks Meren!