[scikit-learn] Can I install Python ML library such as XGBoost without pip?

C W tmrsg11 at gmail.com
Mon Apr 5 11:26:56 EDT 2021


Update:

It seems I've already installed XGBoost before. But, I get the following
error:

>>> import xgboost
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File
"/Users/mike/opt/miniconda3/lib/python3.8/site-packages/xgboost/__init__.py",
line 9, in <module>
    from .core import DMatrix, DeviceQuantileDMatrix, Booster
  File
"/Users/mike/opt/miniconda3/lib/python3.8/site-packages/xgboost/core.py",
line 174, in <module>
    _LIB = _load_lib()
  File
"/Users/mike/opt/miniconda3/lib/python3.8/site-packages/xgboost/core.py",
line 157, in _load_lib
    raise XGBoostError(
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/mike/opt/miniconda3/lib/python3.8/site-packages/xgboost/lib/libxgboost.dylib,
6): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib\n
 Referenced from:
/Users/mike/opt/miniconda3/lib/python3.8/site-packages/xgboost/lib/libxgboost.dylib\n
 Reason: image not found']

It seems OpenMP runtime the one I am missing. I can install by running
> brew install libomp

But, I don't have brew on this computer. Any work around?

Thanks!

On Mon, Apr 5, 2021 at 10:54 AM C W <tmrsg11 at gmail.com> wrote:

> Hello again,
>
> I have 3 follow-up questions.
>
> 1) Upon searching, Anaconda website (
> https://anaconda.org/anaconda/py-xgboost) says that you can install with,
> > conda install -c anaconda py-xgboost
> I have miniconda, not anaconda, I guess I just replace it anaconda with
> minconda?
>
> 2) Using pip3 command,
> > pip3 install xgboost
> I don't have pip.
>
> 3) From XGBoost website, I now see that you can build XGBoost from source (
> https://xgboost.readthedocs.io/en/latest/build.html)
>
> Question: will all the 3 methods install XGBoost in the same folder?
>
> Thanks a lot!
>
> On Mon, Apr 5, 2021 at 10:35 AM C W <tmrsg11 at gmail.com> wrote:
>
>> Hello all,
>>
>> I can't install pip on this computer. It has conda installed (probably
>> not helpful). Is there a work around to install XGBoost and packages?
>>
>> I remember reading on stackoverflow, there were some simple commands to
>> do it. I actually used it to install packages without pip.
>>
>> I can't find the post anymore, could anyone help?
>>
>> Thanks so much!
>>
>> Mike
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/scikit-learn/attachments/20210405/78c5e0f2/attachment.html>


More information about the scikit-learn mailing list