ContinuumIO / anaconda-issues

Anaconda issue tracking
647 stars 220 forks source link

Py-xgboost conflicts with another package #9438

Closed Ingvar-Y closed 6 years ago

Ingvar-Y commented 6 years ago

Hi!

When I try to import eli5, a package available from conda-forge, it results in the following error:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-2-e472a5914de6> in <module>()
----> 1 import eli5

~\AppData\Local\Continuum\anaconda3\lib\site-packages\eli5\__init__.py in <module>()
     51 
     52 try:
---> 53     from .xgboost import (
     54         explain_weights_xgboost,
     55         explain_prediction_xgboost

~\AppData\Local\Continuum\anaconda3\lib\site-packages\eli5\xgboost.py in <module>()
      7 import numpy as np  # type: ignore
      8 import scipy.sparse as sp  # type: ignore
----> 9 from xgboost import (  # type: ignore
     10     XGBClassifier,
     11     XGBRegressor,

~\AppData\Local\Continuum\anaconda3\lib\site-packages\xgboost\__init__.py in <module>()
      9 import os
     10 
---> 11 from .core import DMatrix, Booster
     12 from .training import train, cv
     13 from . import rabit                   # noqa

~\AppData\Local\Continuum\anaconda3\lib\site-packages\xgboost\core.py in <module>()
    113 
    114 # load the XGBoost library globally
--> 115 _LIB = _load_lib()
    116 
    117 

~\AppData\Local\Continuum\anaconda3\lib\site-packages\xgboost\core.py in _load_lib()
    107     if len(lib_path) == 0:
    108         return None
--> 109     lib = ctypes.cdll.LoadLibrary(lib_path[0])
    110     lib.XGBGetLastError.restype = ctypes.c_char_p
    111     return lib

~\AppData\Local\Continuum\anaconda3\lib\ctypes\__init__.py in LoadLibrary(self, name)
    424 
    425     def LoadLibrary(self, name):
--> 426         return self._dlltype(name)
    427 
    428 cdll = LibraryLoader(CDLL)

~\AppData\Local\Continuum\anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    346 
    347         if handle is None:
--> 348             self._handle = _dlopen(self._name, mode)
    349         else:
    350             self._handle = handle

OSError: [WinError 126] The specified module could not be found

As a workaround I tried installing xgboost from another channel which resolved the issue - it seems the problem is on py-xgboost's side.

conda info
    active environment : base
    active env location : C:\Users\I347500\AppData\Local\Continuum\anaconda3
            shell level : 1
       user config file : C:\Users\I347500\.condarc
 populated config files : C:\Users\I347500\.condarc
          conda version : 4.5.4
    conda-build version : 3.10.5
         python version : 3.6.5.final.0
       base environment : C:\Users\I347500\AppData\Local\Continuum\anaconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/win-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/win-64
                          https://repo.anaconda.com/pkgs/pro/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\I347500\AppData\Local\Continuum\anaconda3\pkgs
                          C:\Users\I347500\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\I347500\AppData\Local\Continuum\anaconda3\envs
                          C:\Users\I347500\AppData\Local\conda\conda\envs
                          C:\Users\I347500\.conda\envs
               platform : win-64
             user-agent : conda/4.5.4 requests/2.18.4 CPython/3.6.5 Windows/10 Windows/10.0.16299
          administrator : False
             netrc file : None
           offline mode : False
conda list --show-channel-urls
# packages in environment at C:\Users\I347500\AppData\Local\Continuum\anaconda3:
#
# Name                    Version                   Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0            py36he6757f0_0    defaults
absl-py                   0.2.1                    py36_0    defaults
alabaster                 0.7.10           py36hcd07829_0    defaults
anaconda                  custom           py36h363777c_0    defaults
anaconda-client           1.6.14                   py36_0    defaults
anaconda-navigator        1.8.5                    py36_0    defaults
anaconda-project          0.8.2            py36hfad2e28_0    defaults
arrow-cpp                 0.9.0               py36_vc14_7  [vc14]  conda-forge
asn1crypto                0.24.0                   py36_0    defaults
astor                     0.6.2                    py36_0    defaults
astroid                   1.6.3                    py36_0    defaults
astropy                   3.0.2            py36h452e1ab_1    defaults
attrs                     18.1.0                   py36_0    defaults
babel                     2.5.3                    py36_0    defaults
backcall                  0.1.0                    py36_0    defaults
backports                 1.0              py36h81696a8_1    defaults
backports.shutil_get_terminal_size 1.0.0            py36h79ab834_2    defaults
backports.weakref         1.0.post1        py36hf2695fa_0    defaults
beautifulsoup4            4.6.0            py36hd4cc5e8_1    defaults
bitarray                  0.8.1            py36hfa6e2cd_1    defaults
bkcharts                  0.2              py36h7e685f7_0    defaults
blas                      1.0                         mkl    defaults
blaze                     0.11.3           py36h8a29ca5_0    defaults
bleach                    1.5.0                    py36_0    conda-forge
blosc                     1.14.3               he51fdeb_0    defaults
bokeh                     0.12.16                  py36_0    defaults
boost-cpp                 1.66.0                   vc14_1  [vc14]  conda-forge
boto                      2.48.0           py36h1a776d2_1    defaults
bottleneck                1.2.1            py36hd119dfa_0    defaults
brotli                    1.0.2                    vc14_0  [vc14]  conda-forge
brotlipy                  0.7.0                    py36_0    conda-forge
bzip2                     1.0.6                hfa6e2cd_5    defaults
ca-certificates           2018.03.07                    0    defaults
category_encoders         1.2.6                      py_0    conda-forge
certifi                   2018.4.16                py36_0    defaults
cffi                      1.11.5           py36h945400d_0    defaults
chardet                   3.0.4            py36h420ce6e_1    defaults
click                     6.7              py36hec8c647_0    defaults
cloudpickle               0.5.3                    py36_0    defaults
clyent                    1.2.2            py36hb10d595_1    defaults
cntk                      2.5.1                     <pip>
colorama                  0.3.9            py36h029ae33_0    defaults
comtypes                  1.1.4                    py36_0    defaults
conda                     4.5.4                    py36_0    defaults
conda-build               3.10.5                   py36_0    defaults
conda-env                 2.6.0                h36134e3_1    defaults
conda-verify              2.0.0            py36h065de53_0    defaults
console_shortcut          0.1.1                h6bb2dd7_3    defaults
contextlib2               0.5.5            py36he5d52c0_0    defaults
cryptography              2.2.2            py36hfa6e2cd_0    defaults
curl                      7.59.0               h7602738_0    defaults
cycler                    0.10.0           py36h009560c_0    defaults
cython                    0.28.2           py36hfa6e2cd_0    defaults
cytoolz                   0.9.0.1          py36hfa6e2cd_0    defaults
dask                      0.17.5                   py36_0    defaults
dask-core                 0.17.5                   py36_0    defaults
datashape                 0.5.4            py36h5770b85_0    defaults
decorator                 4.3.0                    py36_0    defaults
distributed               1.21.8                   py36_0    defaults
docutils                  0.14             py36h6012d8f_0    defaults
eli5                      0.8                        py_0    conda-forge
entrypoints               0.2.3            py36hfd66bb0_2    defaults
et_xmlfile                1.0.1            py36h3d2d736_0    defaults
fastcache                 1.0.2            py36hfa6e2cd_2    defaults
fastparquet               0.1.5            py36h452e1ab_0    defaults
filelock                  3.0.4                    py36_0    defaults
flask                     1.0.2                    py36_1    defaults
flask-cors                3.0.4                    py36_0    defaults
freetype                  2.8                  h51f8f2c_1    defaults
future                    0.16.0                   py36_1    defaults
gast                      0.2.0                    py36_0    defaults
get_terminal_size         1.0.0                h38e98db_0    defaults
gevent                    1.3.0            py36hfa6e2cd_0    defaults
glob2                     0.6              py36hdf76b57_0    defaults
graphviz                  2.38.0                        7    conda-forge
greenlet                  0.4.13           py36hfa6e2cd_0    defaults
grpcio                    1.11.0           py36he025d50_0    defaults
h5py                      2.7.1            py36he54a1c3_0    defaults
hdf5                      1.10.1               h98b8871_1    defaults
heapdict                  1.0.0                    py36_2    defaults
html5lib                  0.9999999                py36_0    conda-forge
hyperopt                  0.1.1            py36h256ac0b_0    jaikumarm
icc_rt                    2017.0.4             h97af966_0    defaults
icu                       58.2                 ha66f8fd_1    defaults
idna                      2.6              py36h148d497_1    defaults
imageio                   2.3.0                    py36_0    defaults
imagesize                 1.0.0                    py36_0    defaults
iml                       0.6.0                    py36_0    kvedala
intel-openmp              2018.0.0                      8    defaults
ipykernel                 4.8.2                    py36_0    defaults
ipython                   6.4.0                    py36_0    defaults
ipython_genutils          0.2.0            py36h3c5d0ee_0    defaults
ipywidgets                7.2.1                    py36_0    defaults
isort                     4.3.4                    py36_0    defaults
itsdangerous              0.24             py36hb6c5a24_1    defaults
jdcal                     1.4                      py36_0    defaults
jedi                      0.12.0                   py36_1    defaults
jinja2                    2.10             py36h292fed1_0    defaults
jpeg                      9b                   hb83a4c4_2    defaults
jsonschema                2.6.0            py36h7636477_0    defaults
jupyter                   1.0.0                    py36_4    defaults
jupyter_client            5.2.3                    py36_0    defaults
jupyter_console           5.2.0            py36h6d89b47_1    defaults
jupyter_core              4.4.0            py36h56e9d50_0    defaults
jupyterlab                0.32.1                   py36_0    defaults
jupyterlab_launcher       0.10.5                   py36_0    defaults
keras                     2.1.5                    py36_0    defaults
kiwisolver                1.0.1            py36h12c3424_0    defaults
krb5                      1.16                 he625fcf_6    defaults
lazy-object-proxy         1.3.1            py36hd1c21d2_0    defaults
libcurl                   7.59.0               hc4dcbb0_0    defaults
libgpuarray               0.7.6                hfa6e2cd_0    defaults
libiconv                  1.15                 h1df5818_7    defaults
libpng                    1.6.34               h79bbb47_0    defaults
libprotobuf               3.5.2                he0781b1_0    defaults
libpython                 2.1                      py36_0    defaults
libsodium                 1.0.16               h9d3ae62_0    defaults
libssh2                   1.8.0                hd619d38_4    defaults
libtiff                   4.0.9                hb8ad9f9_1    defaults
libxgboost                0.71                 h6538335_0    defaults
libxml2                   2.9.8                hadb2253_1    defaults
libxslt                   1.1.32               hf6f1972_0    defaults
lightgbm                  2.1.0                    py36_0    conda-forge
lime                      0.1.1.18                 py36_0    conda-forge
llvmlite                  0.23.1           py36hcacf6c6_0    defaults
locket                    0.2.0            py36hfed976d_1    defaults
lxml                      4.2.1            py36heafd4d3_0    defaults
lzo                       2.10                 h6df0209_2    defaults
m2w64-binutils            2.25.1                        5    defaults
m2w64-bzip2               1.0.6                         6    defaults
m2w64-crt-git             5.0.0.4636.2595836               2    defaults
m2w64-gcc                 5.3.0                         6    defaults
m2w64-gcc-ada             5.3.0                         6    defaults
m2w64-gcc-fortran         5.3.0                         6    defaults
m2w64-gcc-libgfortran     5.3.0                         6    defaults
m2w64-gcc-libs            5.3.0                         7    defaults
m2w64-gcc-libs-core       5.3.0                         7    defaults
m2w64-gcc-objc            5.3.0                         6    defaults
m2w64-gmp                 6.1.0                         2    defaults
m2w64-headers-git         5.0.0.4636.c0ad18a               2    defaults
m2w64-isl                 0.16.1                        2    defaults
m2w64-libiconv            1.14                          6    defaults
m2w64-libmangle-git       5.0.0.4509.2e5a9a2               2    defaults
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    defaults
m2w64-make                4.1.2351.a80a8b8               2    defaults
m2w64-mpc                 1.0.3                         3    defaults
m2w64-mpfr                3.1.4                         4    defaults
m2w64-pkg-config          0.29.1                        2    defaults
m2w64-toolchain           5.3.0                         7    defaults
m2w64-tools-git           5.0.0.4592.90b8472               2    defaults
m2w64-windows-default-manifest 6.4                           3    defaults
m2w64-winpthreads-git     5.0.0.4634.697f757               2    defaults
m2w64-zlib                1.2.8                        10    defaults
mako                      1.0.7            py36he15cdb7_0    defaults
markdown                  2.6.11                   py36_0    defaults
markupsafe                1.0              py36h0e26971_1    defaults
matplotlib                2.2.2            py36h153e9ff_1    defaults
mccabe                    0.6.1            py36hb41005a_1    defaults
menuinst                  1.4.13           py36hfa6e2cd_0    defaults
mistune                   0.8.3            py36hfa6e2cd_1    defaults
mkl                       2018.0.2                      1    defaults
mkl-service               1.1.2            py36h57e144c_4    defaults
mkl_fft                   1.0.1            py36h452e1ab_0    defaults
mkl_random                1.0.1            py36h9258bd6_0    defaults
more-itertools            4.1.0                    py36_0    defaults
mpmath                    1.0.0            py36hacc8adf_2    defaults
msgpack-python            0.5.6            py36he980bc4_0    defaults
msys2-conda-epoch         20160418                      1    defaults
multipledispatch          0.5.0                    py36_0    defaults
navigator-updater         0.2.0                    py36_0    defaults
nbconvert                 5.3.1            py36h8dc0fde_0    defaults
nbformat                  4.4.0            py36h3a5bc1b_0    defaults
networkx                  2.1                      py36_0    defaults
nltk                      3.3.0                    py36_0    defaults
nose                      1.3.7            py36h1c3779e_2    defaults
notebook                  5.5.0                    py36_0    defaults
numba                     0.38.0           py36h830ac7b_0    defaults
numexpr                   2.6.5            py36hcd2f87e_0    defaults
numpy                     1.14.3           py36h9fa60d3_1    defaults
numpy-base                1.14.3           py36h555522e_1    defaults
numpydoc                  0.8.0                    py36_0    defaults
odo                       0.5.1            py36h7560279_0    defaults
olefile                   0.45.1                   py36_0    defaults
openpyxl                  2.5.3                    py36_0    defaults
openssl                   1.0.2o               h8ea7d77_0    defaults
packaging                 17.1                     py36_0    defaults
pandas                    0.23.0           py36h830ac7b_0    defaults
pandoc                    1.19.2.1             hb2460c7_1    defaults
pandocfilters             1.4.2            py36h3ef6317_1    defaults
parquet-cpp               1.4.0                    vc14_0  [vc14]  conda-forge
parso                     0.2.0                    py36_0    defaults
partd                     0.3.8            py36hc8e763b_0    defaults
path.py                   11.0.1                   py36_0    defaults
pathlib2                  2.3.2                    py36_0    defaults
patsy                     0.5.0                    py36_0    defaults
pep8                      1.7.1                    py36_0    defaults
pickleshare               0.7.4            py36h9de030f_0    defaults
pillow                    5.1.0            py36h0738816_0    defaults
pip                       10.0.1                   py36_0    defaults
pkginfo                   1.4.2                    py36_1    defaults
pluggy                    0.6.0            py36hc7daf1e_0    defaults
ply                       3.11                     py36_0    defaults
prompt_toolkit            1.0.15           py36h60b8f86_0    defaults
protobuf                  3.5.2            py36h6538335_0    defaults
psutil                    5.4.5            py36hfa6e2cd_0    defaults
py                        1.5.3                    py36_0    defaults
py-xgboost                0.71             py36h6538335_0    defaults
pyarrow                   0.9.0               py36_vc14_1  [vc14]  conda-forge
pycodestyle               2.4.0                    py36_0    defaults
pycosat                   0.6.3            py36h413d8a4_0    defaults
pycparser                 2.18             py36hd053e01_1    defaults
pycrypto                  2.6.1            py36hfa6e2cd_8    defaults
pycurl                    7.43.0.1         py36h74b6da3_0    defaults
pyflakes                  1.6.0            py36h0b975d6_0    defaults
pygments                  2.2.0            py36hb010967_0    defaults
pygpu                     0.7.6            py36h452e1ab_0    defaults
pylint                    1.8.4                    py36_0    defaults
pymongo                   3.4.0                    py36_0    defaults
pyodbc                    4.0.23           py36h6538335_0    defaults
pyopenssl                 18.0.0                   py36_0    defaults
pyparsing                 2.2.0            py36h785a196_1    defaults
pyqt                      5.9.2            py36h1aa27d4_0    defaults
pysocks                   1.6.8                    py36_0    defaults
pytables                  3.4.3            py36he6f6034_0    defaults
pytest                    3.5.1                    py36_0    defaults
pytest-arraydiff          0.2                      py36_0    defaults
pytest-astropy            0.3.0                    py36_0    defaults
pytest-doctestplus        0.1.3                    py36_0    defaults
pytest-openfiles          0.3.0                    py36_0    defaults
pytest-remotedata         0.2.1                    py36_0    defaults
python                    3.6.5                h0c2934d_0    defaults
python-dateutil           2.7.3                    py36_0    defaults
python-graphviz           0.8.2                    py36_0    defaults
python-snappy             0.5.2            py36h6538335_0    defaults
pytz                      2018.4                   py36_0    defaults
pywavelets                0.5.2            py36hc649158_0    defaults
pywin32                   223              py36hfa6e2cd_1    defaults
pywinpty                  0.5.1                    py36_0    defaults
pyyaml                    3.12             py36h1d1928f_1    defaults
pyzmq                     17.0.0           py36hfa6e2cd_1    defaults
qt                        5.9.5            vc14he4a7d60_0    defaults
qtawesome                 0.4.4            py36h5aa48f6_0    defaults
qtconsole                 4.3.1            py36h99a29a9_0    defaults
qtpy                      1.4.1                    py36_0    defaults
requests                  2.18.4           py36h4371aae_1    defaults
rope                      0.10.7           py36had63a69_0    defaults
ruamel_yaml               0.15.35          py36hfa6e2cd_1    defaults
scikit-image              0.13.1           py36hfa6e2cd_1    defaults
scikit-learn              0.19.1           py36h53aea1b_0    defaults
scipy                     1.1.0            py36h672f292_0    defaults
seaborn                   0.8.1            py36h9b69545_0    defaults
send2trash                1.5.0                    py36_0    defaults
setuptools                39.1.0                   py36_0    defaults
shap                      0.14.0                   py36_0    kvedala
simplegeneric             0.8.1                    py36_2    defaults
singledispatch            3.4.0.3          py36h17d0c80_0    defaults
sip                       4.19.8           py36h6538335_0    defaults
six                       1.11.0           py36h4db2310_1    defaults
snappy                    1.1.7                h777316e_3    defaults
snowballstemmer           1.2.1            py36h763602f_0    defaults
sortedcollections         0.6.1                    py36_0    defaults
sortedcontainers          1.5.10                   py36_0    defaults
sphinx                    1.7.4                    py36_0    defaults
sphinxcontrib             1.0              py36hbbac3d2_1    defaults
sphinxcontrib-websupport  1.0.1            py36hb5e5916_1    defaults
spyder                    3.2.8                    py36_0    defaults
sqlalchemy                1.2.7            py36ha85dd04_0    defaults
sqlite                    3.23.1               h35aae40_0    defaults
statsmodels               0.9.0            py36h452e1ab_0    defaults
sympy                     1.1.1            py36h96708e0_0    defaults
tabulate                  0.8.2                    py36_0    defaults
tblib                     1.3.2            py36h30f5020_0    defaults
tensorboard               1.8.0            py36he025d50_0    defaults
tensorflow                1.8.0                         0    defaults
tensorflow-base           1.8.0            py36h1a1b453_0    defaults
termcolor                 1.1.0                    py36_1    defaults
terminado                 0.8.1                    py36_1    defaults
testpath                  0.3.1            py36h2698cfe_0    defaults
theano                    1.0.1                    py36_0    defaults
thrift                    0.11.0           py36h6538335_0    defaults
tk                        8.6.7                hcb92d03_3    defaults
toolz                     0.9.0                    py36_0    defaults
tornado                   5.0.2                    py36_0    defaults
tqdm                      4.23.3                   py36_0    defaults
traitlets                 4.3.2            py36h096827d_0    defaults
typing                    3.6.4                    py36_0    defaults
unicodecsv                0.14.1           py36h6450c06_0    defaults
urllib3                   1.22             py36h276f60a_0    defaults
vc                        14                   h0510ff6_3    defaults
vs2015_runtime            14.0.25123                    3    defaults
wcwidth                   0.1.7            py36h3d5aa90_0    defaults
webencodings              0.5.1            py36h67c50ae_1    defaults
werkzeug                  0.14.1                   py36_0    defaults
wheel                     0.31.1                   py36_0    defaults
widgetsnbextension        3.2.1                    py36_0    defaults
win_inet_pton             1.0.1            py36he67d7fd_1    defaults
win_unicode_console       0.5              py36hcdbd4b5_0    defaults
wincertstore              0.2              py36h7fe50ca_0    defaults
winpty                    0.4.3                         4    defaults
wrapt                     1.10.11          py36he5f5981_0    defaults
xlrd                      1.1.0            py36h1cb58dc_1    defaults
xlsxwriter                1.0.4                    py36_0    defaults
xlwings                   0.11.8                   py36_0    defaults
xlwt                      1.3.0            py36h1a4751e_0    defaults
yaml                      0.1.7                hc54c509_2    defaults
zeromq                    4.2.5                hc6251cf_0    defaults
zict                      0.1.3            py36h2d8e73e_0    defaults
zlib                      1.2.11               h8395fce_2    defaults
mingwandroid commented 6 years ago

Can you show what lib_path contains at this point? lib = ctypes.cdll.LoadLibrary(lib_path[0])

mingwandroid commented 6 years ago

Update, closing.

I am not sure why you filed this bug here instead of the obvious place: https://github.com/conda-forge/eli5-feedstock

.. the rationale is xgboost works correctly on its own and that you could install literally hundreds of things that will not break xgboost, so therefore it's highly likely that eli5 contains the bug here.

mingwandroid commented 6 years ago

Regardless I cannot reproduce this even when using eli5 from conda-forge. I believe you are likely not activating your conda environment correctly here?

I tried the following:

conda create -n xgboost-eli5 python=3.6 py-xgboost=0.71 eli5 -c https://repo.continuum.io/pkgs/main -c conda-forge
conda activate xgboost-eli5
python -c "import eli5"

Adding print(lib_path) to core.py gives:

['C:\\Users\\builder\\m64\\envs\\xgboost\\Library\\mingw-w64\\bin\\xgboost.dll']
mingwandroid commented 6 years ago

My conda list --show-channel-urls:

conda list --show-channel-urls
# packages in environment at C:\Users\builder\m64\envs\xgboost-eli5:
#
# Name                    Version                   Build  Channel
attrs                     18.1.0                   py36_0    defaults
blas                      1.0                         mkl    defaults
certifi                   2018.4.16                py36_0    defaults
eli5                      0.8                        py_0    conda-forge
graphviz                  2.38.0                        7    conda-forge
icc_rt                    2017.0.4             h97af966_0    defaults
intel-openmp              2018.0.0                      8    defaults
jinja2                    2.10             py36h292fed1_0    defaults
libxgboost                0.71                 h6538335_0    defaults
m2w64-gcc-libgfortran     5.3.0                         6    defaults
m2w64-gcc-libs            5.3.0                         7    defaults
m2w64-gcc-libs-core       5.3.0                         7    defaults
m2w64-gmp                 6.1.0                         2    defaults
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    defaults
markupsafe                1.0              py36h0e26971_1    defaults
mkl                       2018.0.2                      1    defaults
mkl_fft                   1.0.1            py36h452e1ab_0    defaults
mkl_random                1.0.1            py36h9258bd6_0    defaults
msys2-conda-epoch         20160418                      1    defaults
numpy                     1.14.3           py36h9fa60d3_1    defaults
numpy-base                1.14.3           py36h555522e_1    defaults
py-xgboost                0.71             py36h6538335_0    defaults
python                    3.6.5                h0c2934d_0    defaults
python-graphviz           0.8.2                    py36_0    defaults
scikit-learn              0.19.1           py36h53aea1b_0    defaults
scipy                     1.1.0            py36h672f292_0    defaults
setuptools                39.1.0                   py36_0    defaults
singledispatch            3.4.0.3          py36h17d0c80_0    defaults
six                       1.11.0           py36h4db2310_1    defaults
tabulate                  0.8.2                    py36_0    defaults
typing                    3.6.4                    py36_0    defaults
vc                        14                   h0510ff6_3    defaults
vs2015_runtime            14.0.25123                    3    defaults
wincertstore              0.2              py36h7fe50ca_0    defaults
Ingvar-Y commented 6 years ago

OK, I checked the obvious and tried import xgboost - it results in the same error.

The contents of lib_path is ['C:\\Users\\I347500\\AppData\\Local\\Continuum\\anaconda3\\Library\\mingw-w64\\bin\\xgboost.dll']

mingwandroid commented 6 years ago

Ok you need to run procmon, insert a pdb.set_trace() at that point, then single step it and look at what DLLs are causing you DLL-hell conflicts here. You'll probably have some core mingw-w64 DLLs in your C:\Windows\System32 folder or something like that.

mingwandroid commented 6 years ago

Also, you say you checked the obvious, but I need you to do that in a minimal environment containing nothing but the essentials (and nothing from conda-forge), so:

conda create -n xgboost python=3.6 py-xgboost=0.71 -c https://repo.continuum.io/pkgs/main
conda activate xgboost
.. then run your tests (and also show the output from conda list --show-channel-urls)
Ingvar-Y commented 6 years ago

OK, I checked, import xgboost works in new xgboost environment

conda list --show-channel-urls
# packages in environment at C:\Users\I347500\AppData\Local\Continuum\anaconda3\envs\xgboost:
#
# Name                    Version                   Build  Channel
blas                      1.0                         mkl    defaults
certifi                   2018.4.16                py36_0    defaults
icc_rt                    2017.0.4             h97af966_0    defaults
intel-openmp              2018.0.0                      8    defaults
libxgboost                0.71                 h6538335_0    defaults
m2w64-gcc-libgfortran     5.3.0                         6    defaults
m2w64-gcc-libs            5.3.0                         7    defaults
m2w64-gcc-libs-core       5.3.0                         7    defaults
m2w64-gmp                 6.1.0                         2    defaults
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    defaults
mkl                       2018.0.2                      1    defaults
mkl_fft                   1.0.1            py36h452e1ab_0    defaults
mkl_random                1.0.1            py36h9258bd6_0    defaults
msys2-conda-epoch         20160418                      1    defaults
numpy                     1.14.3           py36h9fa60d3_1    defaults
numpy-base                1.14.3           py36h555522e_1    defaults
pip                       10.0.1                   py36_0    defaults
py-xgboost                0.71             py36h6538335_0    defaults
python                    3.6.5                h0c2934d_0    defaults
scikit-learn              0.19.1           py36h53aea1b_0    defaults
scipy                     1.1.0            py36h672f292_0    defaults
setuptools                39.1.0                   py36_0    defaults
vc                        14                   h0510ff6_3    defaults
vs2015_runtime            14.0.25123                    3    defaults
wheel                     0.31.1                   py36_0    defaults
wincertstore              0.2              py36h7fe50ca_0    defaults
mingwandroid commented 6 years ago

So something has broken your root environment (possibly some pip usage?). You'll need to figure that out for yourself (maybe try to recreate the same package list in another env and compare the files individually?).

Using environment isolation like this is definitely the recommended approach to using AD/conda though.

Ingvar-Y commented 6 years ago

OK, it's nice to know that the problem is me :) Yes, I used pip to install some packages that i uninstalled later which was probably not wise to do in the root environment. Thank you for your help!

Ingvar-Y commented 6 years ago

Just in case anyone reads this issue in the future, the problem wasn't with packages at all. I used a custom bat file to call jupyter notebook directly from C:\Users\I347500\AppData\Local\Continuum\anaconda3\Scripts which was wrong. Starting jupyter from Anaconda Prompt solved it.

mingwandroid commented 6 years ago

You can use a custom batch file if you wish, but you need to ensure to add call <CONDA_PREFIX>\Scripts\activate.bat at the top.