Closed StrikerRUS closed 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.
@msarahan Please note that in our case numpy
comes from conda
, not pip
.
Thanks for pointing that out. That's more serious. We'll get this fixed as soon as we can.
OK, thanks for the prompt response! I look forward to hearing from you.
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).
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?
@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.
@mingwandroid Please note that everything described here is performed on CI service with clean session, so, base
environment is completely empty.
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:
@mingwandroid Please take a look at the first my message here:
2019-02-14T17:41:49.3286651Z python 3.6.8 h9f7ef89_1 defaults
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?
@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
@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
.
@mingwandroid Thanks for this tip for Appveyor!
Instead you should run: %MINICONDA%\Scripts\activate.bat
Can you explain how that AzurePipelines block 'works'? What is CondaEnvironment@1
about? I don't see any calls to install Miniconda here.
If you are running the right Python then your stdout
would show CondaEcosystemModifyDllSearchPath() :: AddDllDirectory
etc etc. Have you disabled stdout
here?
set doesn't work with powershell, try:
$Env:CONDA_DLL_SEARCH_MODIFICATION_DEBUG = "1"
.. instead.
@mingwandroid Oh, right!
set doesn't work with powershell, try: $Env:CONDA_DLL_SEARCH_MODIFICATION_DEBUG = "1"
Wait a second please.
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.
Sorry, but this is absolutely expected to not work. You're actually very lucky that it has worked at all this whole time:
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.
Huh, they just deprecated CondaEnvironment
yesterday! Thanks a lot for the help. I'll try to activate conda correctly by my own.
Glad to hear they've done that. Thank you for working through this with us too.
Thank you very much, guys, for your help and kindness!
Actual Behavior
Numpy import fails in conda environment with latest build of Python for Windows.
Everything is OK with previous Python builds.
Refer to https://github.com/Microsoft/LightGBM/issues/2010.
Expected Behavior
Successful import.
Steps to Reproduce
Anaconda or Miniconda version:
Operating System:
Windows x64
conda info
conda list --show-channel-urls
Broken environment:
Environment with no problems (on Linux, where Python hasn't been updated yet):
Also, everything is OK with the following environment on Windows where Python 3.5 hasn't been updated yet too:
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.