CNTK 2.2 (CPU version) breaks Anaconda 3 on Windows

Created on 22 Nov 2017  路  15Comments  路  Source: microsoft/CNTK

I tried to install CNTK 2.2 (CPU version) on my Anaconda 3 (Python 3.6) by

pip install https://cntk.ai/PythonWheel/CPU-Only/cntk-2.2-cp36-cp36m-win_amd64.whl

as instructed on this link (https://docs.microsoft.com/en-us/cognitive-toolkit/setup-windows-python?tabs=cntkpy22).

My environment: Windows 10 (64 bit), Python 3.6.3 (64 bit), Qt 5.6.2, PyQt5 5.6, Anaconda 5.0.1, Spyder 3.2.4.

As soon as I installed CNTK 2.2, my Spyder wouldn't start, and also is matplotlib.pyplot (I cannot import matplotlib.pyplot.

The error messages are, respectively:

Traceback (most recent call last):
  File "C:\Anaconda3\Scripts\spyder-script.py", line 5, in <module>
    sys.exit(spyder.app.start.main())
  File "C:\Anaconda3\lib\site-packages\spyder\app\start.py", line 145, in main
    from spyder.app import mainwindow
  File "C:\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 78, in <module>
    from qtpy.compat import from_qvariant
  File "C:\Anaconda3\lib\site-packages\qtpy\compat.py", line 15, in <module>
    from .QtWidgets import QFileDialog
  File "C:\Anaconda3\lib\site-packages\qtpy\QtWidgets.py", line 22, in <module>
    from PyQt5.QtWidgets import *
ImportError: DLL load failed: The specified procedure could not be found.

and

>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Anaconda3\lib\site-packages\matplotlib\pyplot.py", line 29, in <module>
    import matplotlib.colorbar
  File "C:\Anaconda3\lib\site-packages\matplotlib\colorbar.py", line 36, in <module>
    import matplotlib.contour as contour
  File "C:\Anaconda3\lib\site-packages\matplotlib\contour.py", line 21, in <module>
    import matplotlib.font_manager as font_manager
  File "C:\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 58, in <module>
    from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir
ImportError: DLL load failed: The specified procedure could not be found.

I have repeated this process several times (uninstalled Anaconda 3 --> tried opening Spyder and matplotlib.pyplot --> installed CNTK 2.2 --> Spyder and matplotlib.pyplot broke), and was able to replicate the errors.

But CNTK 2.2 (CPU version, Windows) works fine on my Anaconda 2, where Spyder can open, and matplotlib.pyplot can be imported.

Most helpful comment

CNTK 2.2 broke my anaconda navigator several weeks ago, today CNTK 2.3 breaks my matplotlib again, all these issues are due to CNTK puts their "zlib.dll" in Anaconda root folder. I solve this problem by rename "zlib.dll".

All 15 comments

Check out the link: https://github.com/Microsoft/CNTK/issues/2400
It looks like you need to install OpenCv before CNTK(mentioned in its release notes)
https://docs.microsoft.com/en-us/cognitive-toolkit/ReleaseNotes/CNTK_2_2_Release_Notes
I have not had a chance to try it.

CNTK 2.2 broke my anaconda navigator several weeks ago, today CNTK 2.3 breaks my matplotlib again, all these issues are due to CNTK puts their "zlib.dll" in Anaconda root folder. I solve this problem by rename "zlib.dll".

Renaming it to what?

@IsaacCorley any name such as zlib_.dll, just avoid other program finding it by name and make a backup.

@traveller59 Wow it worked. Thanks a ton. Been trying to find a workaround for weeks. I was highly interested in testing out CNTK but breaking matplotlib and spyder was a huge deal-breaker..

@traveller59 I love you, thank you it worked well !

Any plans to fix this @wolfma61 or @n17s? It is causing us a lot of trouble.

This should be fixed in CNTK 2.4.
CNTK don't put zlib.dll in Anaconda root folder anymore. Please reopen the issue if the problem still persist.

Thank you!

Hello, actually renaming the files didn't work for me on an other computer where I tried the trick.

@edmondja Please try CNTK 2.4. If it doesn't fix the issue, feel free to open a new issue with details.

Thank you, this time, the problem is totally eradicated by the update.

Hi,
I have installed CNTK 2.4 for Python 2.7.14 in a new conda environment. It installs successfully, but when i try cntk.all_devices() command to check for GPU, it says python.exe stopped working. I have an NVIDIA GEForce GTX1080 in my system and I have updated the drivers to the latest version (391.01).
I have CNTK 2.3.1 working well in another environment but I need some new 2.4 functions for my project. Been trying to find a solution, but haven't found anything helpful on the internet yet.
I have attached a reference of what happens.
capture

Not sure what the issue is, any help would be appreciated!

I'm having the same issue with python 3.6

(base) C:\Users\MyHome>pip install https://cntk.ai/PythonWheel/GPU/cntk_gpu-2.5.
1-cp36-cp36m-win_amd64.whl
Collecting cntk-gpu==2.5.1 from https://cntk.ai/PythonWheel/GPU/cntk_gpu-2.5.1-c
p36-cp36m-win_amd64.whl
  Using cached https://cntk.ai/PythonWheel/GPU/cntk_gpu-2.5.1-cp36-cp36m-win_amd
64.whl
Requirement already satisfied: scipy>=0.17 in c:\dev\python\jupiter\conda\lib\si
te-packages (from cntk-gpu==2.5.1) (0.19.1)
Requirement already satisfied: numpy>=1.11 in c:\dev\python\jupiter\conda\lib\si
te-packages (from cntk-gpu==2.5.1) (1.13.3)
Installing collected packages: cntk-gpu
Successfully installed cntk-gpu-2.5.1

then
crash

Much thanks to @traveller59
Renaming zlib.dll works for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SudharakaP picture SudharakaP  路  5Comments

lush93 picture lush93  路  5Comments

TheNetAdmin picture TheNetAdmin  路  4Comments

xmm1989218 picture xmm1989218  路  4Comments

pallashadow picture pallashadow  路  5Comments