ContinuumIO / anaconda-issues

Anaconda issue tracking
648 stars 223 forks source link

Numpy import fails due to that the last Python build is broken #10629

Closed StrikerRUS closed 5 years ago

StrikerRUS commented 5 years ago

Actual Behavior

Numpy import fails in conda environment with latest build of Python for Windows.

Everything is OK with previous Python builds.

2019-02-14T17:41:49.4748434Z Traceback (most recent call last):
2019-02-14T17:41:49.4748721Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
2019-02-14T17:41:49.4749202Z     from . import multiarray
2019-02-14T17:41:49.4749603Z ImportError: DLL load failed: The specified module could not be found.
2019-02-14T17:41:49.4750019Z 
2019-02-14T17:41:49.4750386Z During handling of the above exception, another exception occurred:
2019-02-14T17:41:49.4750691Z 
2019-02-14T17:41:49.4751004Z Traceback (most recent call last):
2019-02-14T17:41:49.4751355Z   File "<string>", line 1, in <module>
2019-02-14T17:41:49.4751731Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\__init__.py", line 142, in <module>
2019-02-14T17:41:49.4752081Z     from . import add_newdocs
2019-02-14T17:41:49.4752444Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
2019-02-14T17:41:49.4752771Z     from numpy.lib import add_newdoc
2019-02-14T17:41:49.4753129Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
2019-02-14T17:41:49.4753457Z     from .type_check import *
2019-02-14T17:41:49.4753792Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
2019-02-14T17:41:49.4754116Z     import numpy.core.numeric as _nx
2019-02-14T17:41:49.4754475Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
2019-02-14T17:41:49.4754844Z     raise ImportError(msg)
2019-02-14T17:41:49.4755161Z ImportError: 
2019-02-14T17:41:49.4755480Z Importing the multiarray numpy extension module failed.  Most
2019-02-14T17:41:49.4755825Z likely you are trying to import a failed build of numpy.
2019-02-14T17:41:49.4756178Z If you're working with a numpy git repo, try `git clean -xdf` (removes all
2019-02-14T17:41:49.4756531Z files not under version control).  Otherwise reinstall numpy.
2019-02-14T17:41:49.4756837Z 
2019-02-14T17:41:49.4757187Z Original error was: DLL load failed: The specified module could not be found.

Refer to https://github.com/Microsoft/LightGBM/issues/2010.

Expected Behavior

Successful import.

Steps to Reproduce

python -c "import numpy as np"
Anaconda or Miniconda version:
Operating System:

Windows x64

conda info
2019-02-14T17:41:48.4995505Z      active environment : test-env
2019-02-14T17:41:48.4996142Z     active env location : C:\Users\VssAdministrator\.conda\envs\test-env
2019-02-14T17:41:48.4996604Z        user config file : C:\Users\VssAdministrator\.condarc
2019-02-14T17:41:48.4996982Z  populated config files : 
2019-02-14T17:41:48.4997341Z           conda version : 4.6.3
2019-02-14T17:41:48.4997698Z     conda-build version : not installed
2019-02-14T17:41:48.4998083Z          python version : 3.7.1.final.0
2019-02-14T17:41:48.4998478Z        base environment : C:\Miniconda  (writable)
2019-02-14T17:41:48.4998847Z            channel URLs : https://repo.anaconda.com/pkgs/main/win-64
2019-02-14T17:41:48.4999212Z                           https://repo.anaconda.com/pkgs/main/noarch
2019-02-14T17:41:48.4999638Z                           https://repo.anaconda.com/pkgs/free/win-64
2019-02-14T17:41:48.5000069Z                           https://repo.anaconda.com/pkgs/free/noarch
2019-02-14T17:41:48.5000495Z                           https://repo.anaconda.com/pkgs/r/win-64
2019-02-14T17:41:48.5000879Z                           https://repo.anaconda.com/pkgs/r/noarch
2019-02-14T17:41:48.5001245Z                           https://repo.anaconda.com/pkgs/msys2/win-64
2019-02-14T17:41:48.5001609Z                           https://repo.anaconda.com/pkgs/msys2/noarch
2019-02-14T17:41:48.5001994Z           package cache : C:\Miniconda\pkgs
2019-02-14T17:41:48.5002383Z                           C:\Users\VssAdministrator\.conda\pkgs
2019-02-14T17:41:48.5002755Z                           C:\Users\VssAdministrator\AppData\Local\conda\conda\pkgs
2019-02-14T17:41:48.5003123Z        envs directories : C:\Users\VssAdministrator\.conda\envs
2019-02-14T17:41:48.5003485Z                           C:\Miniconda\envs
2019-02-14T17:41:48.5003881Z                           C:\Users\VssAdministrator\AppData\Local\conda\conda\envs
2019-02-14T17:41:48.5004277Z                platform : win-64
2019-02-14T17:41:48.5005337Z              user-agent : conda/4.6.3 requests/2.21.0 CPython/3.7.1 Windows/10 Windows/10.0.14393
2019-02-14T17:41:48.5005986Z           administrator : True
2019-02-14T17:41:48.5006416Z              netrc file : None
2019-02-14T17:41:48.5006840Z            offline mode : False
conda list --show-channel-urls

Broken environment:

2019-02-14T17:41:49.3277702Z # packages in environment at C:\Users\VssAdministrator\.conda\envs\test-env:
2019-02-14T17:41:49.3278042Z #
2019-02-14T17:41:49.3278108Z # Name                    Version                   Build  Channel
2019-02-14T17:41:49.3278764Z atomicwrites              1.3.0                      py_0    defaults
2019-02-14T17:41:49.3278881Z attrs                     18.2.0           py36h28b3542_0    defaults
2019-02-14T17:41:49.3279348Z blas                      1.0                         mkl    defaults
2019-02-14T17:41:49.3279445Z ca-certificates           2019.1.23                     0    defaults
2019-02-14T17:41:49.3280315Z certifi                   2018.11.29               py36_0    defaults
2019-02-14T17:41:49.3280443Z colorama                  0.4.1                    py36_0    defaults
2019-02-14T17:41:49.3282447Z cycler                    0.10.0           py36h009560c_0    defaults
2019-02-14T17:41:49.3282670Z freetype                  2.9.1                ha9979f8_1    defaults
2019-02-14T17:41:49.3282829Z graphviz                  2.38                 hfd603c8_2    defaults
2019-02-14T17:41:49.3282978Z icc_rt                    2019.0.0             h0cc432a_1    defaults
2019-02-14T17:41:49.3283150Z icu                       58.2                 ha66f8fd_1    defaults
2019-02-14T17:41:49.3283301Z intel-openmp              2019.1                      144    defaults
2019-02-14T17:41:49.3283473Z jpeg                      9b                   hb83a4c4_2    defaults
2019-02-14T17:41:49.3283625Z kiwisolver                1.0.1            py36h6538335_0    defaults
2019-02-14T17:41:49.3283770Z libpng                    1.6.36               h2a8f88b_0    defaults
2019-02-14T17:41:49.3283961Z matplotlib                3.0.2            py36hc8f65d3_0    defaults
2019-02-14T17:41:49.3284121Z mkl                       2019.1                      144    defaults
2019-02-14T17:41:49.3284289Z mkl_fft                   1.0.10           py36h14836fe_0    defaults
2019-02-14T17:41:49.3284434Z mkl_random                1.0.2            py36h343c172_0    defaults
2019-02-14T17:41:49.3284583Z more-itertools            5.0.0                    py36_0    defaults
2019-02-14T17:41:49.3284754Z nose                      1.3.7                    py36_2    defaults
2019-02-14T17:41:49.3284899Z numpy                     1.15.4           py36h19fb1c0_0    defaults
2019-02-14T17:41:49.3285044Z numpy-base                1.15.4           py36hc3f5095_0    defaults
2019-02-14T17:41:49.3285213Z openssl                   1.1.1a               he774522_0    defaults
2019-02-14T17:41:49.3285386Z pandas                    0.24.1           py36ha925a31_0    defaults
2019-02-14T17:41:49.3285581Z pip                       19.0.1                   py36_0    defaults
2019-02-14T17:41:49.3285735Z pluggy                    0.8.1                    py36_0    defaults
2019-02-14T17:41:49.3285879Z psutil                    5.5.0            py36he774522_0    defaults
2019-02-14T17:41:49.3286049Z py                        1.7.0                    py36_0    defaults
2019-02-14T17:41:49.3286193Z pyparsing                 2.3.1                    py36_0    defaults
2019-02-14T17:41:49.3286358Z pyqt                      5.9.2            py36h6538335_2    defaults
2019-02-14T17:41:49.3286504Z pytest                    4.2.0                    py36_0    defaults
2019-02-14T17:41:49.3286651Z python                    3.6.8                h9f7ef89_1    defaults
2019-02-14T17:41:49.3286819Z python-dateutil           2.7.5                    py36_0    defaults
2019-02-14T17:41:49.3286966Z python-graphviz           0.8.4                    py36_1    defaults
2019-02-14T17:41:49.3287144Z pytz                      2018.9                   py36_0    defaults
2019-02-14T17:41:49.3287290Z qt                        5.9.7            vc14h73c81de_0    defaults
2019-02-14T17:41:49.3287462Z scikit-learn              0.20.2           py36h343c172_0    defaults
2019-02-14T17:41:49.3287633Z scipy                     1.2.0            py36h29ff71c_0    defaults
2019-02-14T17:41:49.3287804Z setuptools                40.7.3                   py36_0    defaults
2019-02-14T17:41:49.3287950Z sip                       4.19.8           py36h6538335_0    defaults
2019-02-14T17:41:49.3288117Z six                       1.12.0                   py36_0    defaults
2019-02-14T17:41:49.3288262Z sqlite                    3.26.0               he774522_0    defaults
2019-02-14T17:41:49.3288411Z tornado                   5.1.1            py36hfa6e2cd_0    defaults
2019-02-14T17:41:49.3288580Z vc                        14.1                 h0510ff6_4    defaults
2019-02-14T17:41:49.3288900Z vs2015_runtime            14.15.26706          h3a45250_0    defaults
2019-02-14T17:41:49.3289077Z wheel                     0.32.3                   py36_0    defaults
2019-02-14T17:41:49.3289878Z wincertstore              0.2              py36h7fe50ca_0    defaults
2019-02-14T17:41:49.3290107Z zlib                      1.2.11               h62dcd97_3    defaults

Environment with no problems (on Linux, where Python hasn't been updated yet):


# packages in environment at /home/travis/miniconda/envs/test-env:

#
# Name                    Version                   Build  Channel
atomicwrites              1.3.0                      py_0    defaults
attrs                     18.2.0           py36h28b3542_0    defaults
blas                      1.0                         mkl    defaults
ca-certificates           2019.1.23                     0    defaults
cairo                     1.14.12              h8948797_3    defaults
certifi                   2018.11.29               py36_0    defaults
cycler                    0.10.0                   py36_0    defaults
dbus                      1.13.6               h746ee38_0    defaults
expat                     2.2.6                he6710b0_0    defaults
fontconfig                2.13.0               h9420a91_0    defaults
freetype                  2.9.1                h8a8886c_1    defaults
fribidi                   1.0.5                h7b6447c_0    defaults
glib                      2.56.2               hd408876_0    defaults
graphite2                 1.3.13               h23475e2_0    defaults
graphviz                  2.40.1               h21bd128_2    defaults
gst-plugins-base          1.14.0               hbbd80ab_1    defaults
gstreamer                 1.14.0               hb453b48_1    defaults
harfbuzz                  1.8.8                hffaf4a1_0    defaults
icu                       58.2                 h9c2bf20_1    defaults
intel-openmp              2019.1                      144    defaults
jpeg                      9b                   h024ee3a_2    defaults
kiwisolver                1.0.1            py36hf484d3e_0    defaults
libedit                   3.1.20181209         hc058e9b_0    defaults
libffi                    3.2.1                hd88cf55_4    defaults
libgcc-ng                 8.2.0                hdf63c60_1    defaults
libgfortran-ng            7.3.0                hdf63c60_0    defaults
libpng                    1.6.36               hbc83047_0    defaults
libstdcxx-ng              8.2.0                hdf63c60_1    defaults
libtiff                   4.0.10               h2733197_2    defaults
libuuid                   1.0.3                h1bed415_2    defaults
libxcb                    1.13                 h1bed415_1    defaults
libxml2                   2.9.9                he19cac6_0    defaults
matplotlib                3.0.2            py36h5429711_0    defaults
mkl                       2019.1                      144    defaults
mkl_fft                   1.0.10           py36ha843d7b_0    defaults
mkl_random                1.0.2            py36hd81dba3_0    defaults
more-itertools            5.0.0                    py36_0    defaults
ncurses                   6.1                  he6710b0_1    defaults
nose                      1.3.7                    py36_2    defaults
numpy                     1.15.4           py36h7e9f1db_0    defaults
numpy-base                1.15.4           py36hde5b4d6_0    defaults
openssl                   1.1.1a               h7b6447c_0    defaults
pandas                    0.24.1           py36he6710b0_0    defaults
pango                     1.42.4               h049681c_0    defaults
pcre                      8.42                 h439df22_0    defaults
pip                       19.0.1                   py36_0    defaults
pixman                    0.36.0               h7b6447c_0    defaults
pluggy                    0.8.1                    py36_0    defaults
psutil                    5.5.0            py36h7b6447c_0    defaults
py                        1.7.0                    py36_0    defaults
pyparsing                 2.3.1                    py36_0    defaults
pyqt                      5.9.2            py36h05f1152_2    defaults
pytest                    4.2.0                    py36_0    defaults
python                    3.6.8                h0371630_0    defaults
python-dateutil           2.7.5                    py36_0    defaults
python-graphviz           0.8.4                    py36_1    defaults
pytz                      2018.9                   py36_0    defaults
qt                        5.9.7                h5867ecd_1    defaults
readline                  7.0                  h7b6447c_5    defaults
scikit-learn              0.20.2           py36hd81dba3_0    defaults
scipy                     1.2.0            py36h7c811a0_0    defaults
setuptools                40.7.3                   py36_0    defaults
sip                       4.19.8           py36hf484d3e_0    defaults
six                       1.12.0                   py36_0    defaults
sqlite                    3.26.0               h7b6447c_0    defaults
tk                        8.6.8                hbc83047_0    defaults
tornado                   5.1.1            py36h7b6447c_0    defaults
wheel                     0.32.3                   py36_0    defaults
xz                        5.2.4                h14c3975_4    defaults
zlib                      1.2.11               h7b6447c_3    defaults
zstd                      1.3.7                h0b5b093_0    defaults

Also, everything is OK with the following environment on Windows where Python 3.5 hasn't been updated yet too:

2019-02-14T17:46:16.2269162Z # packages in environment at C:\Users\VssAdministrator\.conda\envs\test-env:
2019-02-14T17:46:16.2269379Z #
2019-02-14T17:46:16.2269436Z # Name                    Version                   Build  Channel
2019-02-14T17:46:16.2269494Z atomicwrites              1.3.0                      py_0    defaults
2019-02-14T17:46:16.2269843Z attrs                     18.2.0           py35h28b3542_0    defaults
2019-02-14T17:46:16.2269900Z blas                      1.0                         mkl    defaults
2019-02-14T17:46:16.2269955Z ca-certificates           2019.1.23                     0    defaults
2019-02-14T17:46:16.2270030Z certifi                   2018.8.24                py35_1    defaults
2019-02-14T17:46:16.2270085Z colorama                  0.3.9            py35h32a752f_0    defaults
2019-02-14T17:46:16.2272357Z cycler                    0.10.0           py35hcc71164_0    defaults
2019-02-14T17:46:16.2272469Z freetype                  2.9.1                ha9979f8_1    defaults
2019-02-14T17:46:16.2272522Z graphviz                  2.38                 hfd603c8_2    defaults
2019-02-14T17:46:16.2272600Z icc_rt                    2019.0.0             h0cc432a_1    defaults
2019-02-14T17:46:16.2272653Z icu                       58.2                 ha66f8fd_1    defaults
2019-02-14T17:46:16.2272997Z intel-openmp              2019.1                      144    defaults
2019-02-14T17:46:16.2273130Z jpeg                      9b                   hb83a4c4_2    defaults
2019-02-14T17:46:16.2273182Z kiwisolver                1.0.1            py35h6538335_0    defaults
2019-02-14T17:46:16.2273234Z libpng                    1.6.36               h2a8f88b_0    defaults
2019-02-14T17:46:16.2273307Z matplotlib                3.0.0            py35hd159220_0    defaults
2019-02-14T17:46:16.2273369Z mkl                       2018.0.3                      1    defaults
2019-02-14T17:46:16.2273420Z mkl_fft                   1.0.6            py35hdbbee80_0    defaults
2019-02-14T17:46:16.2273495Z mkl_random                1.0.1            py35h77b88f5_1    defaults
2019-02-14T17:46:16.2273546Z more-itertools            4.3.0                    py35_0    defaults
2019-02-14T17:46:16.2273599Z nose                      1.3.7                    py35_2    defaults
2019-02-14T17:46:16.2273674Z numpy                     1.15.2           py35ha559c80_0    defaults
2019-02-14T17:46:16.2273736Z numpy-base                1.15.2           py35h8128ebf_0    defaults
2019-02-14T17:46:16.2273787Z openssl                   1.1.1a               he774522_0    defaults
2019-02-14T17:46:16.2273861Z pandas                    0.23.4           py35h830ac7b_0    defaults
2019-02-14T17:46:16.2273912Z pathlib2                  2.3.2                    py35_0    defaults
2019-02-14T17:46:16.2273969Z pip                       10.0.1                   py35_0    defaults
2019-02-14T17:46:16.2274042Z pluggy                    0.7.1            py35h28b3542_0    defaults
2019-02-14T17:46:16.2274093Z psutil                    5.4.7            py35hfa6e2cd_0    defaults
2019-02-14T17:46:16.2274143Z py                        1.6.0                    py35_0    defaults
2019-02-14T17:46:16.2274218Z pyparsing                 2.2.1                    py35_0    defaults
2019-02-14T17:46:16.2274269Z pyqt                      5.9.2            py35h6538335_2    defaults
2019-02-14T17:46:16.2274328Z pytest                    3.8.1                    py35_0    defaults
2019-02-14T17:46:16.2274404Z python                    3.5.6                he025d50_0    defaults
2019-02-14T17:46:16.2274455Z python-dateutil           2.7.3                    py35_0    defaults
2019-02-14T17:46:16.2274506Z python-graphviz           0.8.4                    py35_1    defaults
2019-02-14T17:46:16.2274580Z pytz                      2018.5                   py35_0    defaults
2019-02-14T17:46:16.2274638Z qt                        5.9.7            vc14h73c81de_0    defaults
2019-02-14T17:46:16.2274689Z scikit-learn              0.20.0           py35heebcf9a_1    defaults
2019-02-14T17:46:16.2274762Z scipy                     1.1.0            py35h4f6bf74_1    defaults
2019-02-14T17:46:16.2274814Z setuptools                40.2.0                   py35_0    defaults
2019-02-14T17:46:16.2274888Z sip                       4.19.8           py35h6538335_0    defaults
2019-02-14T17:46:16.2275112Z six                       1.11.0                   py35_1    defaults
2019-02-14T17:46:16.2275166Z sqlite                    3.26.0               he774522_0    defaults
2019-02-14T17:46:16.2275241Z tornado                   5.1.1            py35hfa6e2cd_0    defaults
2019-02-14T17:46:16.2275292Z vc                        14.1                 h0510ff6_4    defaults
2019-02-14T17:46:16.2275345Z vs2015_runtime            14.15.26706          h3a45250_0    defaults
2019-02-14T17:46:16.2275813Z wheel                     0.31.1                   py35_0    defaults
2019-02-14T17:46:16.2275867Z wincertstore              0.2              py35hfebbdb8_0    defaults
2019-02-14T17:46:16.2275918Z zlib                      1.2.11               h62dcd97_3    defaults

The same happens with Python 2.7.

UPD: added another example of environment (on Linux) where the same version of Python hasn't been updated and everything is OK.

msarahan commented 5 years ago

I think this is a duplicate of https://github.com/ContinuumIO/anaconda-issues/issues/10628

please see that issue for workarounds. We are working on a fix.

StrikerRUS commented 5 years ago

@msarahan Please note that in our case numpy comes from conda, not pip.

msarahan commented 5 years ago

Thanks for pointing that out. That's more serious. We'll get this fixed as soon as we can.

StrikerRUS commented 5 years ago

OK, thanks for the prompt response! I look forward to hearing from you.

mingwandroid commented 5 years ago

Can I just check that you are activating your envs here? I failed to reproduce this. The only way I could was by activating my base env (which has Python 3.7.2) then running (via the full path) my test env (which contains Python 2.7.15 and numpy).

mingwandroid commented 5 years ago

Also, from The Anaconda Prompt, can you enter:

conda activate test-env
set CONDA_DLL_SEARCH_MODIFICATION_DEBUG=1
python -c "import numpy as np"

and paste the output please?

StrikerRUS commented 5 years ago

@mingwandroid Of course, the target environment is activated before using.

conda activate doesn't work, I used activate as it was earlier.

conda info --envs
python -c "import numpy as np"

conda activate test-env
python -c "import numpy as np"

conda activate test-env
set CONDA_DLL_SEARCH_MODIFICATION_DEBUG=1
python -c "import numpy as np"
2019-02-14T19:08:10.2428364Z # conda environments:
2019-02-14T19:08:10.2428667Z #
2019-02-14T19:08:10.2429281Z base                     C:\Miniconda
2019-02-14T19:08:10.2429680Z test-env              *  C:\Users\VssAdministrator\.conda\envs\test-env
2019-02-14T19:08:10.2430053Z 
2019-02-14T19:08:10.3880270Z Traceback (most recent call last):
2019-02-14T19:08:10.3880467Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
2019-02-14T19:08:10.3880565Z     from . import multiarray
2019-02-14T19:08:10.3880624Z ImportError: DLL load failed: The specified module could not be found.
2019-02-14T19:08:10.3880664Z 
2019-02-14T19:08:10.3880718Z During handling of the above exception, another exception occurred:
2019-02-14T19:08:10.3880781Z 
2019-02-14T19:08:10.3880827Z Traceback (most recent call last):
2019-02-14T19:08:10.3880879Z   File "<string>", line 1, in <module>
2019-02-14T19:08:10.3881000Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\__init__.py", line 142, in <module>
2019-02-14T19:08:10.3881060Z     from . import add_newdocs
2019-02-14T19:08:10.3881135Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
2019-02-14T19:08:10.3881221Z     from numpy.lib import add_newdoc
2019-02-14T19:08:10.3881285Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
2019-02-14T19:08:10.3881347Z     from .type_check import *
2019-02-14T19:08:10.3881431Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
2019-02-14T19:08:10.3881489Z     import numpy.core.numeric as _nx
2019-02-14T19:08:10.3881552Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
2019-02-14T19:08:10.3881629Z     raise ImportError(msg)
2019-02-14T19:08:10.3881685Z ImportError: 
2019-02-14T19:08:10.3881738Z Importing the multiarray numpy extension module failed.  Most
2019-02-14T19:08:10.3881824Z likely you are trying to import a failed build of numpy.
2019-02-14T19:08:10.3881885Z If you're working with a numpy git repo, try `git clean -xdf` (removes all
2019-02-14T19:08:10.3881943Z files not under version control).  Otherwise reinstall numpy.
2019-02-14T19:08:10.3882002Z 
2019-02-14T19:08:10.3882055Z Original error was: DLL load failed: The specified module could not be found.
2019-02-14T19:08:10.3882094Z 
2019-02-14T19:08:10.6839171Z 
2019-02-14T19:08:10.6839850Z CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
2019-02-14T19:08:10.6840058Z If using 'conda activate' from a batch script, change your
2019-02-14T19:08:10.6840273Z invocation to 'CALL conda.bat activate'.
2019-02-14T19:08:10.6840414Z 
2019-02-14T19:08:10.6840572Z To initialize your shell, run
2019-02-14T19:08:10.6841030Z 
2019-02-14T19:08:10.6841197Z     $ conda init <SHELL_NAME>
2019-02-14T19:08:10.6841336Z 
2019-02-14T19:08:10.6841513Z Currently supported shells are:
2019-02-14T19:08:10.6843415Z   - bash
2019-02-14T19:08:10.6843586Z   - cmd.exe
2019-02-14T19:08:10.6843770Z   - fish
2019-02-14T19:08:10.6843921Z   - tcsh
2019-02-14T19:08:10.6844073Z   - xonsh
2019-02-14T19:08:10.6844251Z   - zsh
2019-02-14T19:08:10.6844399Z   - powershell
2019-02-14T19:08:10.6844536Z 
2019-02-14T19:08:10.6844731Z See 'conda init --help' for more information and options.
2019-02-14T19:08:10.6844872Z 
2019-02-14T19:08:10.6845036Z IMPORTANT: You may need to close and restart your shell after running 'conda init'.
2019-02-14T19:08:10.6845205Z 
2019-02-14T19:08:10.6845332Z 
2019-02-14T19:08:10.7656350Z Traceback (most recent call last):
2019-02-14T19:08:10.7656521Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
2019-02-14T19:08:10.7656608Z     from . import multiarray
2019-02-14T19:08:10.7656684Z ImportError: DLL load failed: The specified module could not be found.
2019-02-14T19:08:10.7656720Z 
2019-02-14T19:08:10.7656782Z During handling of the above exception, another exception occurred:
2019-02-14T19:08:10.7656814Z 
2019-02-14T19:08:10.7656877Z Traceback (most recent call last):
2019-02-14T19:08:10.7656923Z   File "<string>", line 1, in <module>
2019-02-14T19:08:10.7656979Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\__init__.py", line 142, in <module>
2019-02-14T19:08:10.7657053Z     from . import add_newdocs
2019-02-14T19:08:10.7657109Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
2019-02-14T19:08:10.7657161Z     from numpy.lib import add_newdoc
2019-02-14T19:08:10.7657240Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
2019-02-14T19:08:10.7657299Z     from .type_check import *
2019-02-14T19:08:10.7657356Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
2019-02-14T19:08:10.7657441Z     import numpy.core.numeric as _nx
2019-02-14T19:08:10.7657496Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
2019-02-14T19:08:10.7657569Z     raise ImportError(msg)
2019-02-14T19:08:10.7657609Z ImportError: 
2019-02-14T19:08:10.7657656Z Importing the multiarray numpy extension module failed.  Most
2019-02-14T19:08:10.7657726Z likely you are trying to import a failed build of numpy.
2019-02-14T19:08:10.7657779Z If you're working with a numpy git repo, try `git clean -xdf` (removes all
2019-02-14T19:08:10.7657829Z files not under version control).  Otherwise reinstall numpy.
2019-02-14T19:08:10.7657860Z 
2019-02-14T19:08:10.7657928Z Original error was: DLL load failed: The specified module could not be found.
2019-02-14T19:08:10.7657969Z 
2019-02-14T19:08:10.9751071Z 
2019-02-14T19:08:10.9751393Z CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
2019-02-14T19:08:10.9751501Z If using 'conda activate' from a batch script, change your
2019-02-14T19:08:10.9751612Z invocation to 'CALL conda.bat activate'.
2019-02-14T19:08:10.9751646Z 
2019-02-14T19:08:10.9751695Z To initialize your shell, run
2019-02-14T19:08:10.9751726Z 
2019-02-14T19:08:10.9751793Z     $ conda init <SHELL_NAME>
2019-02-14T19:08:10.9751822Z 
2019-02-14T19:08:10.9751868Z Currently supported shells are:
2019-02-14T19:08:10.9751939Z   - bash
2019-02-14T19:08:10.9751984Z   - cmd.exe
2019-02-14T19:08:10.9752030Z   - fish
2019-02-14T19:08:10.9752074Z   - tcsh
2019-02-14T19:08:10.9752142Z   - xonsh
2019-02-14T19:08:10.9752186Z   - zsh
2019-02-14T19:08:10.9752228Z   - powershell
2019-02-14T19:08:10.9752287Z 
2019-02-14T19:08:10.9752338Z See 'conda init --help' for more information and options.
2019-02-14T19:08:10.9752579Z 
2019-02-14T19:08:10.9752640Z IMPORTANT: You may need to close and restart your shell after running 'conda init'.
2019-02-14T19:08:10.9752705Z 
2019-02-14T19:08:10.9753737Z 
2019-02-14T19:08:11.1415921Z Traceback (most recent call last):
2019-02-14T19:08:11.1416651Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
2019-02-14T19:08:11.1417132Z     from . import multiarray
2019-02-14T19:08:11.1417550Z ImportError: DLL load failed: The specified module could not be found.
2019-02-14T19:08:11.1417962Z 
2019-02-14T19:08:11.1418360Z During handling of the above exception, another exception occurred:
2019-02-14T19:08:11.1418726Z 
2019-02-14T19:08:11.1419106Z Traceback (most recent call last):
2019-02-14T19:08:11.1419493Z   File "<string>", line 1, in <module>
2019-02-14T19:08:11.1419951Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\__init__.py", line 142, in <module>
2019-02-14T19:08:11.1420415Z     from . import add_newdocs
2019-02-14T19:08:11.1420819Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
2019-02-14T19:08:11.1421236Z     from numpy.lib import add_newdoc
2019-02-14T19:08:11.1421640Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
2019-02-14T19:08:11.1422070Z     from .type_check import *
2019-02-14T19:08:11.1422495Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
2019-02-14T19:08:11.1422892Z     import numpy.core.numeric as _nx
2019-02-14T19:08:11.1423609Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
2019-02-14T19:08:11.1424391Z     raise ImportError(msg)
2019-02-14T19:08:11.1424840Z ImportError: 
2019-02-14T19:08:11.1425769Z Importing the multiarray numpy extension module failed.  Most
2019-02-14T19:08:11.1426236Z likely you are trying to import a failed build of numpy.
2019-02-14T19:08:11.1426653Z If you're working with a numpy git repo, try `git clean -xdf` (removes all
2019-02-14T19:08:11.1427102Z files not under version control).  Otherwise reinstall numpy.
2019-02-14T19:08:11.1427483Z 
2019-02-14T19:08:11.1427880Z Original error was: DLL load failed: The specified module could not be found.
conda info --envs
python -c "import numpy as np"

activate test-env
python -c "import numpy as np"

activate test-env
set CONDA_DLL_SEARCH_MODIFICATION_DEBUG=1
python -c "import numpy as np"
2019-02-14T19:18:14.8180314Z # conda environments:
2019-02-14T19:18:14.8180787Z #
2019-02-14T19:18:14.8180988Z base                     C:\Miniconda
2019-02-14T19:18:14.8181165Z test-env              *  C:\Users\VssAdministrator\.conda\envs\test-env
2019-02-14T19:18:14.8181311Z 
2019-02-14T19:18:14.9480426Z Traceback (most recent call last):
2019-02-14T19:18:14.9480691Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
2019-02-14T19:18:14.9481086Z     from . import multiarray
2019-02-14T19:18:14.9481445Z ImportError: DLL load failed: The specified module could not be found.
2019-02-14T19:18:14.9481873Z 
2019-02-14T19:18:14.9482172Z During handling of the above exception, another exception occurred:
2019-02-14T19:18:14.9482467Z 
2019-02-14T19:18:14.9482749Z Traceback (most recent call last):
2019-02-14T19:18:14.9483064Z   File "<string>", line 1, in <module>
2019-02-14T19:18:14.9483496Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\__init__.py", line 142, in <module>
2019-02-14T19:18:14.9483913Z     from . import add_newdocs
2019-02-14T19:18:14.9484386Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
2019-02-14T19:18:14.9484729Z     from numpy.lib import add_newdoc
2019-02-14T19:18:14.9485083Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
2019-02-14T19:18:14.9485437Z     from .type_check import *
2019-02-14T19:18:14.9485771Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
2019-02-14T19:18:14.9486096Z     import numpy.core.numeric as _nx
2019-02-14T19:18:14.9486427Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
2019-02-14T19:18:14.9486779Z     raise ImportError(msg)
2019-02-14T19:18:14.9487296Z ImportError: 
2019-02-14T19:18:14.9487602Z Importing the multiarray numpy extension module failed.  Most
2019-02-14T19:18:14.9487907Z likely you are trying to import a failed build of numpy.
2019-02-14T19:18:14.9488194Z If you're working with a numpy git repo, try `git clean -xdf` (removes all
2019-02-14T19:18:14.9488701Z files not under version control).  Otherwise reinstall numpy.
2019-02-14T19:18:14.9488975Z 
2019-02-14T19:18:14.9489449Z Original error was: DLL load failed: The specified module could not be found.
2019-02-14T19:18:14.9489789Z 
2019-02-14T19:18:15.2108273Z Traceback (most recent call last):
2019-02-14T19:18:15.2108808Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
2019-02-14T19:18:15.2109012Z     from . import multiarray
2019-02-14T19:18:15.2109210Z ImportError: DLL load failed: The specified module could not be found.
2019-02-14T19:18:15.2109330Z 
2019-02-14T19:18:15.2109463Z During handling of the above exception, another exception occurred:
2019-02-14T19:18:15.2109606Z 
2019-02-14T19:18:15.2109733Z Traceback (most recent call last):
2019-02-14T19:18:15.2111252Z   File "<string>", line 1, in <module>
2019-02-14T19:18:15.2111439Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\__init__.py", line 142, in <module>
2019-02-14T19:18:15.2111598Z     from . import add_newdocs
2019-02-14T19:18:15.2111761Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
2019-02-14T19:18:15.2111903Z     from numpy.lib import add_newdoc
2019-02-14T19:18:15.2112048Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
2019-02-14T19:18:15.2112208Z     from .type_check import *
2019-02-14T19:18:15.2112353Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
2019-02-14T19:18:15.2112516Z     import numpy.core.numeric as _nx
2019-02-14T19:18:15.2112660Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
2019-02-14T19:18:15.2112808Z     raise ImportError(msg)
2019-02-14T19:18:15.2112957Z ImportError: 
2019-02-14T19:18:15.2113098Z Importing the multiarray numpy extension module failed.  Most
2019-02-14T19:18:15.2113257Z likely you are trying to import a failed build of numpy.
2019-02-14T19:18:15.2113396Z If you're working with a numpy git repo, try `git clean -xdf` (removes all
2019-02-14T19:18:15.2113651Z files not under version control).  Otherwise reinstall numpy.
2019-02-14T19:18:15.2114099Z 
2019-02-14T19:18:15.2114280Z Original error was: DLL load failed: The specified module could not be found.
2019-02-14T19:18:15.2114409Z 
2019-02-14T19:18:15.5417205Z Traceback (most recent call last):
2019-02-14T19:18:15.5417378Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
2019-02-14T19:18:15.5417464Z     from . import multiarray
2019-02-14T19:18:15.5417512Z ImportError: DLL load failed: The specified module could not be found.
2019-02-14T19:18:15.5417568Z 
2019-02-14T19:18:15.5417632Z During handling of the above exception, another exception occurred:
2019-02-14T19:18:15.5417677Z 
2019-02-14T19:18:15.5417714Z Traceback (most recent call last):
2019-02-14T19:18:15.5417754Z   File "<string>", line 1, in <module>
2019-02-14T19:18:15.5417829Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\__init__.py", line 142, in <module>
2019-02-14T19:18:15.5417879Z     from . import add_newdocs
2019-02-14T19:18:15.5417929Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
2019-02-14T19:18:15.5417999Z     from numpy.lib import add_newdoc
2019-02-14T19:18:15.5418053Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
2019-02-14T19:18:15.5418100Z     from .type_check import *
2019-02-14T19:18:15.5418170Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
2019-02-14T19:18:15.5418224Z     import numpy.core.numeric as _nx
2019-02-14T19:18:15.5418465Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
2019-02-14T19:18:15.5418514Z     raise ImportError(msg)
2019-02-14T19:18:15.5418551Z ImportError: 
2019-02-14T19:18:15.5418593Z Importing the multiarray numpy extension module failed.  Most
2019-02-14T19:18:15.5418662Z likely you are trying to import a failed build of numpy.
2019-02-14T19:18:15.5418710Z If you're working with a numpy git repo, try `git clean -xdf` (removes all
2019-02-14T19:18:15.5418778Z files not under version control).  Otherwise reinstall numpy.
2019-02-14T19:18:15.5418808Z 
2019-02-14T19:18:15.5418850Z Original error was: DLL load failed: The specified module could not be found.
StrikerRUS commented 5 years ago

@mingwandroid Please note that everything described here is performed on CI service with clean session, so, base environment is completely empty.

mingwandroid commented 5 years ago

I do not think that your test-env contains one of these new pythons at present because CONDA_DLL_SEARCH_MODIFICATION_DEBUG=1 is doing nothing. You should have seen something like:

python -c "import numpy as np"
CondaEcosystemModifyDllSearchPath() :: PATH=C:\Users\builder\mc3\envs\test-env;C:\Users\builder\mc3\envs\test-env\Library\mingw-w64\bin;C:\Users\builder\mc3\envs\test-env\Library\usr\bin;C:\Users\builder\mc3\envs\test-env\Library\bin;C:\Users\builder\mc3\envs\test-env\Scripts;C:\Users\builder\mc3\envs\test-env\bin;C:\Users\builder\mc3\condabin;C:\Users\builder\mc3\condabin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\PuTTY\;C:\Program Files\TortoiseHg\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\curl\src;C:\git\mingw64\bin;;C:\WINDOWS\System32\OpenSSH\;C:\Users\builder\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\;;C:\Users\builder\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\builder\AppData\Local\Microsoft\WindowsApps
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Users\builder\AppData\Local\Microsoft\WindowsApps)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Users\builder\AppData\Local\Programs\Microsoft VS Code\bin)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Users\builder\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\WINDOWS\System32\OpenSSH)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\git\mingw64\bin)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\curl\src)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\WINDOWS\System32\WindowsPowerShell\v1.0)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\WINDOWS\System32\Wbem)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\WINDOWS)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\WINDOWS\system32)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\TortoiseHg)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files (x86)\PuTTY)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\WINDOWS\System32\WindowsPowerShell\v1.0)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\WINDOWS\System32\Wbem)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\WINDOWS)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\WINDOWS\system32)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Users\builder\mc3\condabin)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Users\builder\mc3\condabin)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Users\builder\mc3\envs\test-env\bin)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Users\builder\mc3\envs\test-env\Scripts)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Users\builder\mc3\envs\test-env\Library\bin)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Users\builder\mc3\envs\test-env\Library\usr\bin)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Users\builder\mc3\envs\test-env\Library\mingw-w64\bin)
CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Users\builder\mc3\envs\test-env)

Can you check again? The python build numbers you need are one of:

  1. python-3.6.8 = h9f7ef89_1
  2. python-3.7.2 = h8c8aaf0_2
  3. python-2.7.15 = hcb6e200_7
StrikerRUS commented 5 years ago

@mingwandroid Please take a look at the first my message here:

2019-02-14T17:41:49.3286651Z python                    3.6.8                h9f7ef89_1    defaults
mingwandroid commented 5 years ago

I can get this to reproduce, but only if I run the test-env python.exe without having the test-env folders on PATH, as in:

conda create -q -n test-env python=%PYTHON_VERSION% matplotlib nose numpy pandas psutil pytest python-graphviz scikit-learn scipy
%MINICONDA%\envs\test-env\python.exe -c "import numpy as np"

I am guessing you use this file for AppVeyor CI?

https://github.com/Microsoft/LightGBM/blob/8e286b38a3f597bc7fbe2905b8d71ea20340fe71/.appveyor.yml

You should not manipulate PATH manually as you are doing here: https://github.com/Microsoft/LightGBM/blob/8e286b38a3f597bc7fbe2905b8d71ea20340fe71/.appveyor.yml#L29

Instead you should run:

%MINICONDA%\Scripts\activate.bat

I don't know how AppVeyor works very well, but my guess is that you need to call %MINICONDA%\Scripts\activate.bat test-env in each of https://github.com/Microsoft/LightGBM/blob/8e286b38a3f597bc7fbe2905b8d71ea20340fe71/.appveyor.yml#L36 and https://github.com/Microsoft/LightGBM/blob/8e286b38a3f597bc7fbe2905b8d71ea20340fe71/.appveyor.yml#L43 because I assume that these stages (install, build_script and test_script) are independent of each other?

mingwandroid commented 5 years ago

@StrikerRUS, sorry, you have run some other python.exe here, otherwise you would have seen the CondaEcosystemModifyDllSearchPath() output that I posted.

To help to convince yourself of this please look at the patch in question: https://github.com/AnacondaRecipes/python-feedstock/blob/master/recipe/0020-Add-CondaEcosystemModifyDllSearchPath.patch

StrikerRUS commented 5 years ago

@mingwandroid Nope, on Appveyor everything is OK because we use there versions of Python which haven't been updated (installed by Appveyor staff).

Issue started to appear on Azure Pipelines sdist and bdist jobs (Python 2.7 and 3.6) yesterday: https://github.com/Microsoft/LightGBM/blob/master/.vsts-ci.yml#L127-L152 https://github.com/Microsoft/LightGBM/blob/StrikerRUS-patch-1/.ci/test_windows.ps1

conda info --envs
python -c "import numpy as np"

yields

2019-02-14T19:18:14.8180314Z # conda environments:
2019-02-14T19:18:14.8180787Z #
2019-02-14T19:18:14.8180988Z base                     C:\Miniconda
2019-02-14T19:18:14.8181165Z test-env              *  C:\Users\VssAdministrator\.conda\envs\test-env
2019-02-14T19:18:14.8181311Z 
2019-02-14T19:18:14.9480426Z Traceback (most recent call last):
2019-02-14T19:18:14.9480691Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
2019-02-14T19:18:14.9481086Z     from . import multiarray
2019-02-14T19:18:14.9481445Z ImportError: DLL load failed: The specified module could not be found.
...

So, I think I'm using the "right" Python.

UPD: fixed the right branch in link of simple test_windows.ps1.

StrikerRUS commented 5 years ago

@mingwandroid Thanks for this tip for Appveyor!

Instead you should run: %MINICONDA%\Scripts\activate.bat

mingwandroid commented 5 years ago

Can you explain how that AzurePipelines block 'works'? What is CondaEnvironment@1 about? I don't see any calls to install Miniconda here.

mingwandroid commented 5 years ago

If you are running the right Python then your stdout would show CondaEcosystemModifyDllSearchPath() :: AddDllDirectory etc etc. Have you disabled stdout here?

StrikerRUS commented 5 years ago

I think here it is https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks/CondaEnvironmentV1

mingwandroid commented 5 years ago

set doesn't work with powershell, try:

$Env:CONDA_DLL_SEARCH_MODIFICATION_DEBUG = "1"

.. instead.

StrikerRUS commented 5 years ago

@mingwandroid Oh, right!

set doesn't work with powershell, try: $Env:CONDA_DLL_SEARCH_MODIFICATION_DEBUG = "1"

Wait a second please.

StrikerRUS commented 5 years ago

The output of

conda info --envs
python -c "import numpy as np"

$Env:CONDA_DLL_SEARCH_MODIFICATION_DEBUG = "1"
python -c "import numpy as np"

is the following:

2019-02-14T20:08:52.0207431Z # conda environments:
2019-02-14T20:08:52.0207541Z #
2019-02-14T20:08:52.0207769Z base                     C:\Miniconda
2019-02-14T20:08:52.0207847Z test-env              *  C:\Users\VssAdministrator\.conda\envs\test-env
2019-02-14T20:08:52.0207885Z 
2019-02-14T20:08:52.1435679Z Traceback (most recent call last):
2019-02-14T20:08:52.1436133Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
2019-02-14T20:08:52.1436333Z     from . import multiarray
2019-02-14T20:08:52.1436480Z ImportError: DLL load failed: The specified module could not be found.
2019-02-14T20:08:52.1436630Z 
2019-02-14T20:08:52.1436787Z During handling of the above exception, another exception occurred:
2019-02-14T20:08:52.1436904Z 
2019-02-14T20:08:52.1437149Z Traceback (most recent call last):
2019-02-14T20:08:52.1437319Z   File "<string>", line 1, in <module>
2019-02-14T20:08:52.1437473Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\__init__.py", line 142, in <module>
2019-02-14T20:08:52.1437642Z     from . import add_newdocs
2019-02-14T20:08:52.1437809Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
2019-02-14T20:08:52.1437958Z     from numpy.lib import add_newdoc
2019-02-14T20:08:52.1438134Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
2019-02-14T20:08:52.1438283Z     from .type_check import *
2019-02-14T20:08:52.1438452Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
2019-02-14T20:08:52.1438808Z     import numpy.core.numeric as _nx
2019-02-14T20:08:52.1439077Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
2019-02-14T20:08:52.1439255Z     raise ImportError(msg)
2019-02-14T20:08:52.1439396Z ImportError: 
2019-02-14T20:08:52.1439564Z Importing the multiarray numpy extension module failed.  Most
2019-02-14T20:08:52.1439727Z likely you are trying to import a failed build of numpy.
2019-02-14T20:08:52.1439883Z If you're working with a numpy git repo, try `git clean -xdf` (removes all
2019-02-14T20:08:52.1440057Z files not under version control).  Otherwise reinstall numpy.
2019-02-14T20:08:52.1440303Z 
2019-02-14T20:08:52.1440444Z Original error was: DLL load failed: The specified module could not be found.
2019-02-14T20:08:52.1440588Z 
2019-02-14T20:08:52.1573851Z CondaEcosystemModifyDllSearchPath() :: PATH=C:\Users\VssAdministrator\.conda\envs\test-env;C:\Users\VssAdministrator\.conda\envs\test-env\Scripts;C:\Miniconda;C:\Miniconda\Scripts;C:\agents\2.146.0\externals\git\cmd;C:\cf-cli;C:\Program Files (x86)\NSIS\;C:\Program Files\dotnet;C:\mysql-5.7.21-winx64\bin;C:\Program Files\Java\zulu-8-azure-jdk_8.33.0.1-8.0.192-win_x64\bin;C:\npm\prefix;C:\hostedtoolcache\windows\Ruby\2.5.0\x64\bin;C:\Go1.11.4\bin;C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64;C:\Program Files\Microsoft MPI\Bin\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\Chocolatey\bin;C:\Program Files\Docker;C:\Program Files\PowerShell\6\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\Git\cmd;C:\tools\php73;C:\Program Files (x86)\Subversion\bin;C:\Program Files\nodejs\;C:\Program Files\CMake\bin;C:\Program Files\Mercurial;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\OpenSSL\bin;C:\Users\VssAdministrator\AppData\Local\Microsoft\WindowsApps
2019-02-14T20:08:52.1576048Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Users\VssAdministrator\AppData\Local\Microsoft\WindowsApps)
2019-02-14T20:08:52.1576228Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\OpenSSL\bin)
2019-02-14T20:08:52.1576390Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Strawberry\perl\bin)
2019-02-14T20:08:52.1576561Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Strawberry\perl\site\bin)
2019-02-14T20:08:52.1576706Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Strawberry\c\bin)
2019-02-14T20:08:52.1576847Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\Mercurial)
2019-02-14T20:08:52.1577033Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\CMake\bin)
2019-02-14T20:08:52.1577182Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\nodejs)
2019-02-14T20:08:52.1577348Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files (x86)\Subversion\bin)
2019-02-14T20:08:52.1577491Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\tools\php73)
2019-02-14T20:08:52.1577630Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\Git\cmd)
2019-02-14T20:08:52.1577936Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager)
2019-02-14T20:08:52.1578097Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code)
2019-02-14T20:08:52.1578274Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit)
2019-02-14T20:08:52.1578424Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn)
2019-02-14T20:08:52.1578607Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn)
2019-02-14T20:08:52.1578755Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn)
2019-02-14T20:08:52.1578920Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn)
2019-02-14T20:08:52.1579078Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn)
2019-02-14T20:08:52.1579223Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\Microsoft SQL Server\130\Tools\Binn)
2019-02-14T20:08:52.1579388Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\dotnet)
2019-02-14T20:08:52.1579531Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\PowerShell\6)
2019-02-14T20:08:52.2002599Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\Docker)
2019-02-14T20:08:52.2002964Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\ProgramData\Chocolatey\bin)
2019-02-14T20:08:52.2003165Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\windows\System32\WindowsPowerShell\v1.0)
2019-02-14T20:08:52.2003335Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\windows\System32\Wbem)
2019-02-14T20:08:52.2003545Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\windows)
2019-02-14T20:08:52.2003710Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\windows\system32)
2019-02-14T20:08:52.2003896Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\Microsoft MPI\Bin)
2019-02-14T20:08:52.2004067Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64)
2019-02-14T20:08:52.2004247Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Scripts)
2019-02-14T20:08:52.2004692Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin)
2019-02-14T20:08:52.2004872Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\Git\mingw64\bin)
2019-02-14T20:08:52.2005054Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\Git\usr\bin)
2019-02-14T20:08:52.2005214Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\Git\bin)
2019-02-14T20:08:52.2005389Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Go1.11.4\bin)
2019-02-14T20:08:52.2005547Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\hostedtoolcache\windows\Ruby\2.5.0\x64\bin)
2019-02-14T20:08:52.2005699Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\npm\prefix)
2019-02-14T20:08:52.2005879Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\Java\zulu-8-azure-jdk_8.33.0.1-8.0.192-win_x64\bin)
2019-02-14T20:08:52.2006144Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\mysql-5.7.21-winx64\bin)
2019-02-14T20:08:52.2006308Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files\dotnet)
2019-02-14T20:08:52.2006450Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Program Files (x86)\NSIS)
2019-02-14T20:08:52.2006589Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\cf-cli)
2019-02-14T20:08:52.2006979Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\agents\2.146.0\externals\git\cmd)
2019-02-14T20:08:52.2007125Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Miniconda\Scripts)
2019-02-14T20:08:52.2007290Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Miniconda)
2019-02-14T20:08:52.2007438Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Users\VssAdministrator\.conda\envs\test-env\Scripts)
2019-02-14T20:08:52.2007586Z CondaEcosystemModifyDllSearchPath() :: AddDllDirectory(C:\Users\VssAdministrator\.conda\envs\test-env)
2019-02-14T20:08:52.2013993Z Traceback (most recent call last):
2019-02-14T20:08:52.2014432Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
2019-02-14T20:08:52.2014761Z     from . import multiarray
2019-02-14T20:08:52.2015038Z ImportError: DLL load failed: The specified module could not be found.
2019-02-14T20:08:52.2015190Z 
2019-02-14T20:08:52.2015333Z During handling of the above exception, another exception occurred:
2019-02-14T20:08:52.2015476Z 
2019-02-14T20:08:52.2015633Z Traceback (most recent call last):
2019-02-14T20:08:52.2015868Z   File "<string>", line 1, in <module>
2019-02-14T20:08:52.2016037Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\__init__.py", line 142, in <module>
2019-02-14T20:08:52.2016195Z     from . import add_newdocs
2019-02-14T20:08:52.2016339Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
2019-02-14T20:08:52.2016681Z     from numpy.lib import add_newdoc
2019-02-14T20:08:52.2016828Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
2019-02-14T20:08:52.2016964Z     from .type_check import *
2019-02-14T20:08:52.2017131Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
2019-02-14T20:08:52.2017279Z     import numpy.core.numeric as _nx
2019-02-14T20:08:52.2017440Z   File "C:\Users\VssAdministrator\.conda\envs\test-env\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
2019-02-14T20:08:52.2017577Z     raise ImportError(msg)
2019-02-14T20:08:52.2017821Z ImportError: 
2019-02-14T20:08:52.2017984Z Importing the multiarray numpy extension module failed.  Most
2019-02-14T20:08:52.2018130Z likely you are trying to import a failed build of numpy.
2019-02-14T20:08:52.2018278Z If you're working with a numpy git repo, try `git clean -xdf` (removes all
2019-02-14T20:08:52.2018458Z files not under version control).  Otherwise reinstall numpy.
2019-02-14T20:08:52.2018581Z 
2019-02-14T20:08:52.2018722Z Original error was: DLL load failed: The specified module could not be found.
msarahan commented 5 years ago

Sorry, but this is absolutely expected to not work. You're actually very lucky that it has worked at all this whole time:

https://github.com/Microsoft/azure-pipelines-tasks/blob/master/Tasks/CondaEnvironmentV1/conda_internal.ts#L73-L87

When conda activates an environment, it adds 5 entries to PATH. Those azure pipelines scripts look like they are only adding 2 of them. You ideally need to use the official conda powershell support (see conda init in conda 4.6). At a minimum, if you can't get that to work, you need to add $PREFIX/Library/bin to PATH. This used to be added in by our python package as a patch, but it has been removed because it was breaking conda. It's not coming back, and though we're sorry for the brokenness, we maintain that if you're not using conda to activate environments, you are operating in an unsupported way.

StrikerRUS commented 5 years ago

Huh, they just deprecated CondaEnvironment yesterday! Thanks a lot for the help. I'll try to activate conda correctly by my own.

mingwandroid commented 5 years ago

Glad to hear they've done that. Thank you for working through this with us too.

StrikerRUS commented 5 years ago

Thank you very much, guys, for your help and kindness!