Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matplotlib import issues - Could not load DLL #6689

Open
drcrook1 opened this issue Oct 16, 2017 · 45 comments
Open

Matplotlib import issues - Could not load DLL #6689

drcrook1 opened this issue Oct 16, 2017 · 45 comments

Comments

@drcrook1
Copy link

Windows 10 machine w/Anaconda 5 and Python 3.6.
I deleted full old Anaconda folder and installed Anaconda on top of it. Possible this caused some issues and am willing to give a whirl at the "proper" uninstall method (couldn't find docs on that).

Until then, this is what I've got as an issue and am logging here. Please feel free to request any additional details.

Actual Error Trace:


ImportError Traceback (most recent call last)
in ()
2 import io
3 import scipy.misc as misc
----> 4 import matplotlib.pyplot as plt
5 get_ipython().magic('matplotlib inline')
6

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\pyplot.py in ()
27 from cycler import cycler
28 import matplotlib
---> 29 import matplotlib.colorbar
30 from matplotlib import style
31 from matplotlib import _pylab_helpers, interactive

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\colorbar.py in ()
34 import matplotlib.collections as collections
35 import matplotlib.colors as colors
---> 36 import matplotlib.contour as contour
37 import matplotlib.cm as cm
38 import matplotlib.gridspec as gridspec

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\contour.py in ()
19 import matplotlib.colors as colors
20 import matplotlib.collections as mcoll
---> 21 import matplotlib.font_manager as font_manager
22 import matplotlib.text as text
23 import matplotlib.cbook as cbook

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\font_manager.py in ()
56
57 import matplotlib
---> 58 from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir
59 from matplotlib.compat import subprocess
60 from matplotlib.fontconfig_pattern import (

ImportError: DLL load failed: The specified procedure could not be found.

@drcrook1
Copy link
Author

drcrook1 commented Oct 16, 2017

I've narrowed this down specifically to:

from import matplotlib import ft2font

C:\WINDOWS\system32>python
Python 3.6.2 |Anaconda custom (64-bit)| (default, Sep 19 2017, 08:03:39) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import ft2font
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'ft2font'
from matplotlib import ft2font
Traceback (most recent call last):
File "", line 1, in
ImportError: DLL load failed: The specified procedure could not be found.
from matplotlib import afm
from matplotlib import cbook
from matplotlib import rcParams
from matplotlib import get_cachedir

@mingwandroid
Copy link

Can you retry from the Anaconda Prompt?

@drcrook1
Copy link
Author

Appears to be the same:

(C:\ProgramData\Anaconda3) C:\Users\DrCrook\Documents>python
Python 3.6.2 |Anaconda custom (64-bit)| (default, Sep 19 2017, 08:03:39) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

from matplotlib import ft2font
Traceback (most recent call last):
File "", line 1, in
ImportError: DLL load failed: The specified procedure could not be found.

@8c
Copy link

8c commented Nov 7, 2017

I have the same error. However, using a simple "import matplotlib" does not cause such error
`Python 3.6.3 |Anaconda, Inc.| (default, Oct 27 2017, 12:22:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

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

@CompPhysChris
Copy link

I mentioned this in another issue, but the culprit is the matplotlib.ft2font import. I tested importing each of the packages individually and the other four worked just fine.

@msarahan
Copy link
Contributor

What's the output from

conda list
and
conda info

@CompPhysChris
Copy link

CompPhysChris commented Nov 14, 2017

conda list

_license 1.1 py36_1
alabaster 0.7.10 py36hcd07829_0
anaconda custom py36h363777c_0
anaconda-client 1.6.5 py36hd36550c_0
anaconda-project 0.8.0 py36h8b3bf89_0
asn1crypto 0.22.0 py36h8e79faa_1
astroid 1.5.3 py36h9d85297_0
astropy 2.0.2 py36h06391c4_4
babel 2.5.0 py36h35444c1_0
backports 1.0 py36h81696a8_1
backports.functools_lru_cache 1.4 py36_1 conda-forge
backports.shutil_get_terminal_size 1.0.0 py36h79ab834_2
beautifulsoup4 4.6.0 py36hd4cc5e8_1
better-apidoc 0.1.2
bitarray 0.8.1 py36h6af124b_0
bkcharts 0.2 py36h7e685f7_0
blaze 0.11.3 py36h8a29ca5_0
bleach 2.0.0 py36h0a7e3d6_0
bleach 2.0.0
bokeh 0.12.10 py36h0be3b39_0
boto 2.48.0 py36h1a776d2_1
bottleneck 1.2.1 py36hd119dfa_0
bzip2 1.0.6 haa5b126_2
ca-certificates 2017.08.26 h94faf87_0
cachecontrol 0.12.3 py36hfe50d7b_0
certifi 2017.7.27.1 py36h043bc9e_0
cffi 1.10.0 py36hae3d1b5_1
chardet 3.0.4 py36h420ce6e_1
click 6.7 py36hec8c647_0
cloudpickle 0.4.0 py36h639d8dc_0
clyent 1.2.2 py36hb10d595_1
colorama 0.3.9 py36h029ae33_0
colorcet 0.9.1
comtypes 1.1.2 py36heb9b3d1_0
conda 4.3.30 py36h7e176b0_0
conda-env 2.6.0 h36134e3_1
console_shortcut 0.1.1 h6bb2dd7_3
contextlib2 0.5.5 py36he5d52c0_0
cryptography 2.0.3 py36h123decb_1
curl 7.55.1 h3b839b5_4
cycler 0.10.0 py36h009560c_0
cython 0.26.1 py36h18049ac_0
cytoolz 0.8.2 py36h547e66e_0
dask 0.15.4 py36hd19ff53_0
dask-core 0.15.4 py36h22c9028_0
datashape 0.5.4 py36h5770b85_0
decorator 4.1.2 py36he63a57b_0
dill 0.2.7.1
distlib 0.2.5 py36h51371be_0
distributed 1.19.1 py36h8504682_0
DM3Utils 0.1
docutils 0.14 py36h6012d8f_0
entrypoints 0.2.3 py36hfd66bb0_2
et_xmlfile 1.0.1 py36h3d2d736_0
fastcache 1.0.2 py36hffdae1b_0
FileGrammar 0.1
filelock 2.0.12 py36hd7ddd41_0
flask 0.12.2 py36h98b5e8f_0
flask-cors 3.0.3 py36h8a3855d_0
freetype 2.8 h51f8f2c_1
get_terminal_size 1.0.0 h38e98db_0
gevent 1.2.2 py36h342a76c_0
git 2.14.1 h8288424_2
glob2 0.5 py36h11cc1bd_1
greenlet 0.4.12 py36ha00ad21_0
h5py 2.7.1
h5py 2.7.0 py36hfbe0a52_1
hdf5 1.10.1 vc14hb361328_0 [vc14]
heapdict 1.0.0 py36h21fa5f4_0
html5lib 0.999999999 py36ha09b1f3_0
html5lib 0.999999999
icc_rt 2017.0.4 h97af966_0
icu 58.2 vc14hc45fdbb_0 [vc14]
idna 2.6 py36h148d497_1
imageio 2.2.0 py36had6c2d2_0
imagesize 0.7.1 py36he29f638_0
intel-openmp 2018.0.0 hcd89f80_7
ipykernel 4.6.1 py36hbb77b34_0
ipython 6.1.0 py36h236ecc8_1
ipython 6.2.1
ipython_genutils 0.2.0 py36h3c5d0ee_0
ipywidgets 7.0.0 py36h2e74ada_0
ipywidgets 7.0.0
isort 4.2.15 py36h6198cc5_0
itsdangerous 0.24 py36hb6c5a24_1
jdcal 1.3 py36h64a5255_0
jedi 0.10.2 py36hed927a0_0
jedi 0.11.0
jinja2 2.9.6 py36h10aa3a0_1
joblib 0.11
jpeg 9b hb83a4c4_2
jsonschema 2.6.0 py36h7636477_0
jupyter 1.0.0 py36h422fd7e_2
jupyter_client 5.1.0 py36h9902a9a_0
jupyter_console 5.2.0 py36h6d89b47_1
jupyter_core 4.3.0 py36h511e818_0
jupyterlab 0.27.0 py36h34cc53b_2
jupyterlab_launcher 0.4.0 py36h22c3ccf_0
krb5 1.14.2 vc14hfaa12e2_3 [vc14]
lazy-object-proxy 1.3.1 py36hd1c21d2_0
libiconv 1.15 h1df5818_7
libpng 1.6.32 vc14h5163883_3 [vc14]
libssh2 1.8.0 vc14hcf584a9_2 [vc14]
libtiff 4.0.8 vc14h04e2a1e_10 [vc14]
libxml2 2.9.4 vc14h8fd0f11_5 [vc14]
libxslt 1.1.29 vc14hf85b8d4_5 [vc14]
llvmlite 0.20.0 py36_0
locket 0.2.0 py36hfed976d_1
lockfile 0.12.2 py36h0468280_0
lxml 4.1.0 py36h0dcd83c_0
lzo 2.10 vc14h0a64fa6_1 [vc14]
markupsafe 1.0 py36h0e26971_1
matplotlib 2.1.0 py36h11b4b9c_0
matplotlib 2.1.0
mccabe 0.6.1 py36hb41005a_1
menuinst 1.4.10 py36h42196fb_0
mistune 0.8.1 py36h007b88b_0
mkl 2018.0.0 h36b65af_4
mkl-service 1.1.2 py36h57e144c_4
mpmath 0.19 py36he326802_2
msgpack-python 0.4.8 py36h58b1e9d_0
multipledispatch 0.4.9 py36he44c36e_0
multiprocess 0.70.5
nanonispy 1.0.4
nbconvert 5.3.1 py36h8dc0fde_0
nbconvert 5.3.1
nbformat 4.4.0 py36h3a5bc1b_0
nbformat 4.4.0
neo 0.5.1
networkx 2.0 py36hff991e3_0
nltk 3.2.4 py36hd0e0a39_0
nose 1.3.7 py36h1c3779e_2
notebook 5.2.1 py36h4fb2ca6_0
numba 0.35.0 np113py36_10
numexpr 2.6.2 py36h514de0f_2
numpy 1.13.0
numpy 1.13.3
numpy 1.13.3 py36ha320f96_0
numpydoc 0.7.0 py36ha25429e_0
odo 0.5.1 py36h7560279_0
olefile 0.44 py36h0a7bdd2_0
openpyxl 2.4.8 py36hf3b77f6_1
openssl 1.0.2m vc14h7f35f9e_0 [vc14]
packaging 16.8 py36ha0986f6_1
pandas 0.21.0 py36he09d4dd_1
pandoc 1.19.2.1 hb2460c7_1
pandocfilters 1.4.2 py36h3ef6317_1
pandocfilters 1.4.2
parso 0.1.0
partd 0.3.8 py36hc8e763b_0
path.py 10.3.1 py36h3dd8b46_0
pathlib2 2.3.0 py36h7bfb78b_0
pathos 0.2.1
patsy 0.4.1 py36h42cefec_0
pep8 1.7.0 py36h0f3d67a_0
pickleshare 0.7.4 py36h9de030f_0
pillow 4.2.1 py36hdb25ab2_0
Pillow 4.3.0
pip 9.0.1 py36h226ae91_4
pkginfo 1.4.1
pkginfo 1.4.1 py36hb0f9cfa_1
ply 3.10 py36h1211beb_0
pox 0.2.3
ppft 1.6.4.7.1
progress 1.3 py36hbeca8d3_0
prompt-toolkit 1.0.15
prompt_toolkit 1.0.15 py36h60b8f86_0
psutil 5.3.0
psutil 5.4.0 py36h4e662fb_0
psutil 5.4.1
py 1.4.34 py36ha4aca3a_1
pycodestyle 2.3.1 py36h7cc55cd_0
pycosat 0.6.3 py36h413d8a4_0
pycparser 2.18 py36hd053e01_1
pycrypto 2.6.1 py36he68e6e2_1
pycurl 7.43.0 py36h086bf4c_3
pyflakes 1.6.0 py36h0b975d6_0
pygments 2.2.0 py36hb010967_0
pylint 1.7.4 py36ha4e6ded_0
pyodbc 4.0.17 py36h0006bc2_0
pyopenssl 17.2.0 py36h15ca2fc_0
pyparsing 2.2.0 py36h785a196_1
pyqt 5.6.0 py36hb5ed885_5
pyqtgraph 0.10.0
pyreadline 2.1
pysocks 1.6.7 py36h698d350_1
pysptools 0.14.2
pytables 3.4.2 py36h71138e3_2
pytest 3.2.1 py36h753b05e_1
python 3.6.3 h3b118a2_4
python-dateutil 2.6.1 py36h509ddcb_1
pytz 2017.2 py36h05d413f_1
pytz 2017.3
pywavelets 0.5.2 py36hc649158_0
pywin32 221 py36h9c10281_0
pyyaml 3.12 py36h1d1928f_1
pyzmq 16.0.2 py36h38c27d9_2
qt 5.6.2 vc14h6f8c307_12 [vc14]
qtawesome 0.4.4 py36h5aa48f6_0
qtconsole 4.3.1 py36h99a29a9_0
qtpy 1.3.1 py36hb8717c5_0
quantities 0.11.1+36.gacba339
requests 2.18.4 py36h4371aae_1
requests-toolbelt 0.8.0
rope 0.10.5 py36hcaf5641_0
ruamel_yaml 0.11.14 py36h9b16331_2
scikit-image 0.13.0 py36h6dffa3f_1
scikit-learn 0.19.1 py36h53aea1b_0
scipy 1.0.0 py36h1260518_0
seaborn 0.8.0 py36h62cb67c_0
setuptools 36.5.0 py36h65f9e6e_0
setuptools 36.5.0
simplegeneric 0.8.1 py36heab741f_0
singledispatch 3.4.0.3 py36h17d0c80_0
sip 4.19.5
sip 4.18.1 py36h9c25514_2
six 1.11.0
six 1.11.0 py36h4db2310_1
sklearn 0.0
snowballstemmer 1.2.1 py36h763602f_0
sortedcollections 0.5.3 py36hbefa0ab_0
sortedcontainers 1.5.7 py36ha90ac20_0
sphinx 1.6.3 py36h9bb690b_0
sphinx-gallery 0.1.12
sphinx-rtd-theme 0.2.4
sphinxcontrib 1.0 py36hbbac3d2_1
sphinxcontrib-websupport 1.0.1 py36hb5e5916_1
spyder 3.2.4 py36h8845eaa_0
sqlalchemy 1.1.13 py36h5948d12_0
sqlite 3.20.1 h9eeafa9_2
statsmodels 0.8.0 py36h6189b4c_0
sympy 1.1.1 py36h96708e0_0
tblib 1.3.2 py36h30f5020_0
testpath 0.3.1
testpath 0.3.1 py36h2698cfe_0
tk 8.6.7 hcb92d03_3
toolz 0.8.2 py36he152a52_0
tornado 4.5.2 py36h57f6048_0
tqdm 4.14.0
traitlets 4.3.2 py36h096827d_0
twine 1.9.1
typing 3.6.2 py36hb035bda_0
unicodecsv 0.14.1 py36h6450c06_0
urllib3 1.22 py36h276f60a_0
vc 14 h2379b0c_2
vs2015_runtime 14.0.25123 hd4c4e62_2
wcwidth 0.1.7 py36h3d5aa90_0
webencodings 0.5.1
webencodings 0.5.1 py36h67c50ae_1
werkzeug 0.12.2 py36h866a736_0
wget 3.2
wheel 0.29.0 py36h6ce6cde_1
whych 0.2.1
widgetsnbextension 3.0.6
widgetsnbextension 3.0.2
widgetsnbextension 3.0.2 py36h364476f_1
win_inet_pton 1.0.1 py36he67d7fd_1
win_unicode_console 0.5 py36hcdbd4b5_0
wincertstore 0.2 py36h7fe50ca_0
wrapt 1.10.11 py36he5f5981_0
xlrd 1.1.0 py36h1cb58dc_1
xlrd 1.1.0
xlsxwriter 1.0.2 py36hf723b7d_0
xlwings 0.11.4 py36hd3cf94d_0
xlwt 1.3.0 py36h1a4751e_0
yaml 0.1.7 hdd19a5b_2
zict 0.1.3 py36h2d8e73e_0
zlib 1.2.11 h8395fce_2

conda info

           platform : win-64
      conda version : 4.3.30
   conda is private : False
  conda-env version : 4.3.30
conda-build version : not installed
     python version : 3.6.3.final.0
   requests version : 2.18.4
   root environment : C:\Users\cq6\AppData\Local\Continuum\Anaconda3  (writable)
default environment : C:\Users\cq6\AppData\Local\Continuum\Anaconda3
   envs directories : C:\Users\cq6\AppData\Local\Continuum\Anaconda3\envs
                      C:\Users\cq6\AppData\Local\conda\conda\envs
                      C:\Users\cq6\.conda\envs
      package cache : C:\Users\cq6\AppData\Local\Continuum\Anaconda3\pkgs
                      C:\Users\cq6\AppData\Local\conda\conda\pkgs
       channel URLs : https://repo.continuum.io/pkgs/main/win-64
                      https://repo.continuum.io/pkgs/main/noarch
                      https://repo.continuum.io/pkgs/free/win-64
                      https://repo.continuum.io/pkgs/free/noarch
                      https://repo.continuum.io/pkgs/r/win-64
                      https://repo.continuum.io/pkgs/r/noarch
                      https://repo.continuum.io/pkgs/pro/win-64
                      https://repo.continuum.io/pkgs/pro/noarch
                      https://repo.continuum.io/pkgs/msys2/win-64
                      https://repo.continuum.io/pkgs/msys2/noarch
        config file : C:\Users\cq6\.condarc
         netrc file : None
       offline mode : False
         user-agent : conda/4.3.30 requests/2.18.4 CPython/3.6.3 Windows/7 Windows/6.1.7601
      administrator : False

@msarahan
Copy link
Contributor

Nothing obviously wrong there. Did this originally work, but stopped after an update to something or an installation of something?

@CompPhysChris
Copy link

It worked last week. I did conda update --all and my work may have pushed updates to my Windows machine over the weekend. This week I tried to debug some code and started getting the error.

@ccordoba12
Copy link

@CompPhysChris, what if you run

conda install -f matplotlib

? Does that fix your problem?

@CompPhysChris
Copy link

No, it's still giving the same error.

@msarahan
Copy link
Contributor

Sorry, I just tried to reproduce in a win 7 VM, and things work OK for me. Here's what I did:

  • Install Anaconda3-5.0.1-win64
  • try the " matplotlib.pyplot as plt" command in ipython
  • run conda update --all
  • try the " matplotlib.pyplot as plt" command in ipython

I suspected our freetype package, but I seem to have the same one as you:

(C:\Users\builder\Anaconda3) C:\Users\builder>conda list
# packages in environment at C:\Users\builder\Anaconda3:
#
_ipyw_jlab_nb_ext_conf    0.1.0            py36he6757f0_0
alabaster                 0.7.10           py36hcd07829_0
anaconda                  custom           py36h363777c_0
anaconda-client           1.6.5            py36hd36550c_0
anaconda-navigator        1.6.9            py36hc720852_0
anaconda-project          0.8.0            py36h8b3bf89_0
asn1crypto                0.22.0           py36h8e79faa_1
astroid                   1.5.3            py36h9d85297_0
astropy                   2.0.2            py36h06391c4_4
babel                     2.5.0            py36h35444c1_0
backports                 1.0              py36h81696a8_1
backports.shutil_get_terminal_size 1.0.0            py36h79ab834_2
beautifulsoup4            4.6.0            py36hd4cc5e8_1
bitarray                  0.8.1            py36h6af124b_0
bkcharts                  0.2              py36h7e685f7_0
blaze                     0.11.3           py36h8a29ca5_0
bleach                    2.0.0            py36h0a7e3d6_0
bokeh                     0.12.10          py36h0be3b39_0
boto                      2.48.0           py36h1a776d2_1
bottleneck                1.2.1            py36hd119dfa_0
bzip2                     1.0.6                haa5b126_2
ca-certificates           2017.08.26           h94faf87_0
cachecontrol              0.12.3           py36hfe50d7b_0
certifi                   2017.7.27.1      py36h043bc9e_0
cffi                      1.10.0           py36hae3d1b5_1
chardet                   3.0.4            py36h420ce6e_1
click                     6.7              py36hec8c647_0
cloudpickle               0.4.0            py36h639d8dc_0
clyent                    1.2.2            py36hb10d595_1
colorama                  0.3.9            py36h029ae33_0
comtypes                  1.1.2            py36heb9b3d1_0
conda                     4.3.30           py36h7e176b0_0
conda-build               3.0.29           py36h39b3f2e_0
conda-env                 2.6.0                h36134e3_1
conda-verify              2.0.0            py36h065de53_0
console_shortcut          0.1.1                h6bb2dd7_3
contextlib2               0.5.5            py36he5d52c0_0
cryptography              2.0.3            py36h123decb_1
curl                      7.55.1               h3b839b5_4
cycler                    0.10.0           py36h009560c_0
cython                    0.26.1           py36h18049ac_0
cytoolz                   0.8.2            py36h547e66e_0
dask                      0.15.4           py36hd19ff53_0
dask-core                 0.15.4           py36h22c9028_0
datashape                 0.5.4            py36h5770b85_0
decorator                 4.1.2            py36he63a57b_0
distlib                   0.2.5            py36h51371be_0
distributed               1.19.1           py36h8504682_0
docutils                  0.14             py36h6012d8f_0
entrypoints               0.2.3            py36hfd66bb0_2
et_xmlfile                1.0.1            py36h3d2d736_0
fastcache                 1.0.2            py36hffdae1b_0
filelock                  2.0.12           py36hd7ddd41_0
flask                     0.12.2           py36h98b5e8f_0
flask-cors                3.0.3            py36h8a3855d_0
freetype                  2.8                  h51f8f2c_1
get_terminal_size         1.0.0                h38e98db_0
gevent                    1.2.2            py36h342a76c_0
glob2                     0.5              py36h11cc1bd_1
greenlet                  0.4.12           py36ha00ad21_0
h5py                      2.7.0            py36hfbe0a52_1
hdf5                      1.10.1           vc14hb361328_0  [vc14]
heapdict                  1.0.0            py36h21fa5f4_0
html5lib                  0.999999999      py36ha09b1f3_0
icc_rt                    2017.0.4             h97af966_0
icu                       58.2             vc14hc45fdbb_0  [vc14]
idna                      2.6              py36h148d497_1
imageio                   2.2.0            py36had6c2d2_0
imagesize                 0.7.1            py36he29f638_0
intel-openmp              2018.0.0             hcd89f80_7
ipykernel                 4.6.1            py36hbb77b34_0
ipython                   6.1.0            py36h236ecc8_1
ipython_genutils          0.2.0            py36h3c5d0ee_0
ipywidgets                7.0.0            py36h2e74ada_0
isort                     4.2.15           py36h6198cc5_0
itsdangerous              0.24             py36hb6c5a24_1
jdcal                     1.3              py36h64a5255_0
jedi                      0.10.2           py36hed927a0_0
jinja2                    2.9.6            py36h10aa3a0_1
jpeg                      9b                   hb83a4c4_2
jsonschema                2.6.0            py36h7636477_0
jupyter                   1.0.0            py36h422fd7e_2
jupyter_client            5.1.0            py36h9902a9a_0
jupyter_console           5.2.0            py36h6d89b47_1
jupyter_core              4.3.0            py36h511e818_0
jupyterlab                0.27.0           py36h34cc53b_2
jupyterlab_launcher       0.4.0            py36h22c3ccf_0
lazy-object-proxy         1.3.1            py36hd1c21d2_0
libiconv                  1.15                 h1df5818_7
libpng                    1.6.32           vc14h5163883_3  [vc14]
libssh2                   1.8.0            vc14hcf584a9_2  [vc14]
libtiff                   4.0.8           vc14h04e2a1e_10  [vc14]
libxml2                   2.9.4            vc14h8fd0f11_5  [vc14]
libxslt                   1.1.29           vc14hf85b8d4_5  [vc14]
llvmlite                  0.20.0                   py36_0
locket                    0.2.0            py36hfed976d_1
lockfile                  0.12.2           py36h0468280_0
lxml                      4.1.0            py36h0dcd83c_0
lzo                       2.10             vc14h0a64fa6_1  [vc14]
markupsafe                1.0              py36h0e26971_1
matplotlib                2.1.0            py36h11b4b9c_0
mccabe                    0.6.1            py36hb41005a_1
menuinst                  1.4.10           py36h42196fb_0
mistune                   0.8.1            py36h007b88b_0
mkl                       2018.0.0             h36b65af_4
mkl-service               1.1.2            py36h57e144c_4
mpmath                    0.19             py36he326802_2
msgpack-python            0.4.8            py36h58b1e9d_0
multipledispatch          0.4.9            py36he44c36e_0
navigator-updater         0.1.0            py36h8a7b86b_0
nbconvert                 5.3.1            py36h8dc0fde_0
nbformat                  4.4.0            py36h3a5bc1b_0
networkx                  2.0              py36hff991e3_0
nltk                      3.2.4            py36hd0e0a39_0
nose                      1.3.7            py36h1c3779e_2
notebook                  5.2.1            py36h4fb2ca6_0
numba                     0.35.0             np113py36_10
numexpr                   2.6.2            py36h514de0f_2
numpy                     1.13.3           py36ha320f96_0
numpydoc                  0.7.0            py36ha25429e_0
odo                       0.5.1            py36h7560279_0
olefile                   0.44             py36h0a7bdd2_0
openpyxl                  2.4.8            py36hf3b77f6_1
openssl                   1.0.2m               h093b818_1
packaging                 16.8             py36ha0986f6_1
pandas                    0.21.0           py36he09d4dd_1
pandoc                    1.19.2.1             hb2460c7_1
pandocfilters             1.4.2            py36h3ef6317_1
partd                     0.3.8            py36hc8e763b_0
path.py                   10.3.1           py36h3dd8b46_0
pathlib2                  2.3.0            py36h7bfb78b_0
patsy                     0.4.1            py36h42cefec_0
pep8                      1.7.0            py36h0f3d67a_0
pickleshare               0.7.4            py36h9de030f_0
pillow                    4.2.1            py36hdb25ab2_0
pip                       9.0.1            py36h226ae91_4
pkginfo                   1.4.1            py36hb0f9cfa_1
ply                       3.10             py36h1211beb_0
progress                  1.3              py36hbeca8d3_0
prompt_toolkit            1.0.15           py36h60b8f86_0
psutil                    5.4.0            py36h4e662fb_0
py                        1.4.34           py36ha4aca3a_1
pycodestyle               2.3.1            py36h7cc55cd_0
pycosat                   0.6.3            py36h413d8a4_0
pycparser                 2.18             py36hd053e01_1
pycrypto                  2.6.1            py36he68e6e2_1
pycurl                    7.43.0           py36h086bf4c_3
pyflakes                  1.6.0            py36h0b975d6_0
pygments                  2.2.0            py36hb010967_0
pylint                    1.7.4            py36ha4e6ded_0
pyodbc                    4.0.17           py36h0006bc2_0
pyopenssl                 17.2.0           py36h15ca2fc_0
pyparsing                 2.2.0            py36h785a196_1
pyqt                      5.6.0            py36hb5ed885_5
pysocks                   1.6.7            py36h698d350_1
pytables                  3.4.2            py36h71138e3_2
pytest                    3.2.1            py36h753b05e_1
python                    3.6.3                h3b118a2_4
python-dateutil           2.6.1            py36h509ddcb_1
pytz                      2017.2           py36h05d413f_1
pywavelets                0.5.2            py36hc649158_0
pywin32                   221              py36h9c10281_0
pyyaml                    3.12             py36h1d1928f_1
pyzmq                     16.0.2           py36h38c27d9_2
qt                        5.6.2           vc14h6f8c307_12  [vc14]
qtawesome                 0.4.4            py36h5aa48f6_0
qtconsole                 4.3.1            py36h99a29a9_0
qtpy                      1.3.1            py36hb8717c5_0
requests                  2.18.4           py36h4371aae_1
rope                      0.10.5           py36hcaf5641_0
ruamel_yaml               0.11.14          py36h9b16331_2
scikit-image              0.13.0           py36h6dffa3f_1
scikit-learn              0.19.1           py36h53aea1b_0
scipy                     1.0.0            py36h1260518_0
seaborn                   0.8.0            py36h62cb67c_0
setuptools                36.5.0           py36h65f9e6e_0
simplegeneric             0.8.1            py36heab741f_0
singledispatch            3.4.0.3          py36h17d0c80_0
sip                       4.18.1           py36h9c25514_2
six                       1.11.0           py36h4db2310_1
snowballstemmer           1.2.1            py36h763602f_0
sortedcollections         0.5.3            py36hbefa0ab_0
sortedcontainers          1.5.7            py36ha90ac20_0
sphinx                    1.6.3            py36h9bb690b_0
sphinxcontrib             1.0              py36hbbac3d2_1
sphinxcontrib-websupport  1.0.1            py36hb5e5916_1
spyder                    3.2.4            py36h8845eaa_0
sqlalchemy                1.1.13           py36h5948d12_0
sqlite                    3.20.1               h9eeafa9_2
statsmodels               0.8.0            py36h6189b4c_0
sympy                     1.1.1            py36h96708e0_0
tblib                     1.3.2            py36h30f5020_0
testpath                  0.3.1            py36h2698cfe_0
tk                        8.6.7                hcb92d03_3
toolz                     0.8.2            py36he152a52_0
tornado                   4.5.2            py36h57f6048_0
traitlets                 4.3.2            py36h096827d_0
typing                    3.6.2            py36hb035bda_0
unicodecsv                0.14.1           py36h6450c06_0
urllib3                   1.22             py36h276f60a_0
vc                        14                   h2379b0c_2
vs2015_runtime            14.0.25123           hd4c4e62_2
wcwidth                   0.1.7            py36h3d5aa90_0
webencodings              0.5.1            py36h67c50ae_1
werkzeug                  0.12.2           py36h866a736_0
wheel                     0.29.0           py36h6ce6cde_1
widgetsnbextension        3.0.2            py36h364476f_1
win_inet_pton             1.0.1            py36he67d7fd_1
win_unicode_console       0.5              py36hcdbd4b5_0
wincertstore              0.2              py36h7fe50ca_0
wrapt                     1.10.11          py36he5f5981_0
xlrd                      1.1.0            py36h1cb58dc_1
xlsxwriter                1.0.2            py36hf723b7d_0
xlwings                   0.11.4           py36hd3cf94d_0
xlwt                      1.3.0            py36h1a4751e_0
yaml                      0.1.7                hc54c509_2
zict                      0.1.3            py36h2d8e73e_0
zlib                      1.2.11               h8395fce_2

My advice from #1672 (comment) is all I have to offer:

The most likely culprit here is that you have DLLs that are being loaded preferentially before Anaconda's DLLs. Those DLLs seem to be incompatible with the ones that Anaconda uses. The most common way that this happens is when other programs install things into C:\Windows\System32.

Unfortunately, there's nothing we can do on the Anaconda side to overcome this issue - you need to clean up whatever DLL files are interfering. There's more info on how Windows finds DLL files at https://msdn.microsoft.com/en-us/library/7d83bc18.aspx

This particular one looks like freetype2. Fortunately that has few possible dependencies to find. Look for png, zlib, or freetype/ft2 DLLs.

Dependency Walker may also be useful tool to show which libraries are getting picked up: http://www.dependencywalker.com/

@CompPhysChris
Copy link

I didn't find the offending dll, but I was able to get it working again by uninstalling Anaconda and re-installing the latest download version.

@msarahan
Copy link
Contributor

Hm, sorry that's what it took, but glad you got it working again. It seems like we might have issues updating from older versions. If anyone has more info, we'll be happy to look into it.

@BlueProphet
Copy link

If it helps anyone finding this issue. I had this issue on a new windows 10\python 3.6 install after installing a bunch of machine learning packages.

Uninstalling cntk is what fixed the issue.

@mingwandroid
Copy link

mingwandroid commented Nov 23, 2017

For any packages that involve shared libraries, mixing pip with conda is asking for trouble.

@majumderS
Copy link

I faced the same issue after I installed theano,keras and tensorflow in my system. However after restarting the command prompt and rerunning import matplotlib.pyplot, it worked fine.

@jjmaldonis
Copy link

I had this issue after updating quite a few packages in conda using conda update --all. I fixed it simply by uninstalling and reinstalling matplotlib:

conda uninstall matplotlib
conda install matplotlib

@carvetighter
Copy link

carvetighter commented Jun 24, 2018

I have the same issue but the dependency is different.||

Error:

from matplotlib import pyplot

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Frosty SB 02\Anaconda3\lib\site-packages\matplotlib\pyplot.py", line 115, in
_backend_mod, new_figure_manager, draw_if_interactive, show = pylab_setup()
File "C:\Users\Frosty SB 02\Anaconda3\lib\site-packages\matplotlib\backends_init
.py", line 62, in pylab_setup
[backend_name], 0)
File "C:\Users\Frosty SB 02\Anaconda3\lib\site-packages\matplotlib\backends\backend_qt5agg.py", line 15, in
from .backend_qt5 import (
File "C:\Users\Frosty SB 02\Anaconda3\lib\site-packages\matplotlib\backends\backend_qt5.py", line 19, in
import matplotlib.backends.qt_editor.figureoptions as figureoptions
File "C:\Users\Frosty SB 02\Anaconda3\lib\site-packages\matplotlib\backends\qt_editor\figureoptions.py", line 20, in
import matplotlib.backends.qt_editor.formlayout as formlayout
File "C:\Users\Frosty SB 02\Anaconda3\lib\site-packages\matplotlib\backends\qt_editor\formlayout.py", line 54, in
from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore
File "C:\Users\Frosty SB 02\Anaconda3\lib\site-packages\matplotlib\backends\qt_compat.py", line 140, in
from PyQt5 import QtCore, QtGui, QtWidgets
ImportError: DLL load failed: The specified procedure could not be found.

I've tried:

  • uninstall / install Anaconda 3x
  • uninstall / install matplotlib 2x
  • uninstall / install keras, theano, tensorflow 2x
  • Dependency Walker 2.2 doesn't seem to have a version for Windows 10

My environment:

  • conda version : 4.5.4
  • conda-build version : 3.10.9
  • python version : 3.6.5.final.0
  • matplotlib version : 2.2.2

My Guess

What is PyQt5? Would this be the issue? I'm lost on this one. I don't know how to trace dependencies for a DLL. I need a walkthrough / tutorial on how to trace a dependency.

An interesting side-note. If I import the pyplot in Spyder no error but in the command terminal I get the above error. Why would that occur?

@ghost
Copy link

ghost commented Jun 28, 2018

Do you have miktex installed? Have you tried removing miktex from the Windows path?

@carvetighter
Copy link

@behrangqwerty I took miktex out of the Windows path, uninstalled MikTex and TexStudio, then restarted. That worked. Thanks a million, I really appreciate it.

@mobar00
Copy link

mobar00 commented Jul 3, 2018

I'm having this issue as well (Windows 7, 32bit). Here's the error log I'm getting:

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

I've tried un-/reinstalling conda, and updating to the latest version. Also tried specifically updating Matplotlib to the newest version (2.2.2). No dice.

Going through the comment thread here, my next move would be to check my Windows DLLs for conflicting builds/dependencies (?). It seems like @behrangqwerty 's suggestion of uninstalling miktex worked for @carvetighter ... how did you figure out that was the problem?
(I don't have either of those installed)

@ghost
Copy link

ghost commented Jul 3, 2018

I read on some forum that the problem

from PyQt5 import QtCore, QtGui, QtWidgets
ImportError: DLL load failed: The specified procedure could not be found.

might be connected to miktex. But this does not seem to have anything to do with your error. What I did to get rid of

from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir
ImportError: DLL load failed: The specified procedure could not be found.

was to uninstall matplotlib with conda ... and to reinstall it with pip. However, I am not sure how harmful mixing package managers can be. But so far it works for me.

@carvetighter
Copy link

The root issue with me was the update of matplotlib. I would stick with the conda install and deprecate matplotlib to an earlier version.

@jurasan
Copy link

jurasan commented Jul 8, 2018

Uninstalling with conda and installing with pip helped me too.

@jasonsross
Copy link

So I have an interesting version of this issue. I have a python app that runs fine within spyder and even if I double-click the script and have pythonw.exe auto-launch it (its a gui app and I'm on windows). But, I get this same font_manager import error when I try to run this script by calling it from a 3rd party software (specifically: using jsl script in the JMP data analysis application, click here for a taste of what that looks like Any ideas on this? maybe a permissions thing? I only have one python environment: Anaconda3

@jasonsross
Copy link

OK I've figured something out. For me, ft2font was not importing because the program I was launching my python script from had a zlib.dll file of it's own and was inserting itself into my PATH so that the zlib.dll that existed in my Anaconda installation was not being chosen when interpreting the ft2font import. I forced my 3rd party program to remove itself from my path before launching my python script and boom, everything is working.

So how can this help everyone else who's having this error in other situations? Well you need to figure out if you have some duplicates dlls, specifically zlib.dll and freetype.dll, and determine how to force your system to chose the right one during the ft2font import.

Example on windows:
Open a command prompt and type the following (NOTE: the location you do this in could be important if you have multiple python installations, and also you need to consider if you PATH is being adjusted temporarily by any software before your python script is launched. Everyone's situation here is going to be a little different. For me, I had to launch these commands from my 3rd party software to see that it was finding a zlib.dll within it's own install directory)

where zlib.dll
where freetype.dll

If any of these are not in the python environment directory you expect, then determine if you can adjust your PATH (for me, I'm using a temporary windows path adjustment on launch using the set PATH command), uninstall some other software, or just delete the dll if it's left over from something unnecessary.

Hope this helps.

@robbmcleod
Copy link

I had the same problem as @jasonsross with freetype 2.9.1 on Python 3.6.6, Windows 10.

conda install freetype=2.8

fixed the DLL import error. This is with matplotlib 2.2.2+1642 building from source to have compatibility with PySide2, but using conda to provide the dependencies, as described here:

https://matplotlib.org/users/installing.html#building-on-windows

@juhariis
Copy link

juhariis commented Sep 4, 2018

I had quite similar issues: weird error messages when importing matplotlib

Found out that the Microsoft Cognitive Services Toolkit I had installed (2.0) was not compatible with the latest Anaconda version I had installed onto my Win 10 laptop today.

After installing CSTK 2.5.1 the problem vanished..

@Anderbone
Copy link

Uninstalling with conda and installing with pip helped me too.

Save me today. Also works for numpy, scipy...

@TheTomer
Copy link

TheTomer commented Nov 8, 2018

Uninstalling with conda and installing with pip helped me too.

This solved it for me as well, thanks!

@Houinside
Copy link

Uninstalling with conda and installing with pip helped me too.

Just use this command
pip install --upgrade --force-reinstall matplotlib

@peyruz
Copy link

peyruz commented May 23, 2019

importing pandas before matplotlib takes care of this.

@zwang17
Copy link

zwang17 commented May 24, 2019

Didn't help as well

@florrolf
Copy link

Doing following import solved the issue for me on Windows 10
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

@frank-yifei-wang
Copy link

frank-yifei-wang commented Nov 6, 2019

Same issue on my machine (Win10 64-bit, Conda 4.7.12, Python 3.7.3.final.0) - import matplotlib works fine but import matplotlib.pyplot as plt throws the error.

Spent hours trying different methods found from GitHub/StackOverflow with no luck. Finally fixed the issue by downgrading to matplotlib 3.0.3 ("older stable version" as stated by the official website).

conda uninstall matplotlib
conda install matplotlib==3.0.3

@dzelge
Copy link

dzelge commented Nov 7, 2019

try conda conf --set channel priority strict and use conda-forge channel. That usually helps.

From here

@DavidJenny
Copy link

for me the answer by janh in this post here solved the issue

@avipsita
Copy link

Traceback (most recent call last):
File "player_adjuster.py", line 9, in
import matplotlib.pyplot as plt
File "C:\Python36\lib\site-packages\matplotlib_init_.py", line 174, in
check_versions()
File "C:\Python36\lib\site-packages\matplotlib_init
.py", line 159, in _check_versions
from . import ft2font
ImportError: DLL load failed: The specified module could not be found.

Getting this error. Tried some of the solutions provided here, but no luck. Can anyone tell me what the problem is ?

@dzelge
Copy link

dzelge commented Aug 21, 2020

Traceback (most recent call last):
File "player_adjuster.py", line 9, in
import matplotlib.pyplot as plt
File "C:\Python36\lib\site-packages\matplotlib__init__.py", line 174, in
check_versions() File "C:\Python36\lib\site-packages\matplotlib__init_.py", line 159, in _check_versions
from . import ft2font
ImportError: DLL load failed: The specified module could not be found.

Getting this error. Tried some of the solutions provided here, but no luck. Can anyone tell me what the problem is ?

Can you provide more info? E.g.: conda info and conda list

These things usually happen when you mix channels.

@Rahul1947116
Copy link

I had this issue after updating quite a few packages in conda using conda update --all. I fixed it simply by uninstalling and reinstalling matplotlib:

conda uninstall matplotlib
conda install matplotlib

Worked !

@mostafa610
Copy link

It never worked when i removed matplotlib and installing it, it worked after i removed python 3.8 and installing python 3.5

@kottoz
Copy link

kottoz commented Dec 18, 2020

conda update --all is worked for me.

@zadacka
Copy link

zadacka commented Oct 19, 2021

I've just had this problem with a new (and incompatible?) zlib.dll appearing in the path.

File "C:\file\path\blah\lib\site-packages\matplotlib\font_manager.py", line 48, in <module>
    from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir
ImportError: DLL load failed: The specified procedure could not be found.

Thank you very much @jasonsross for the suggestion about looking for them (where zlib.dll) in the PATH. How did you know to do that? I'd love to see how you got from "DLL load failed" to looking for zlib.dll. I did not see a link until your post here suggested looking here...

@Jeitan
Copy link

Jeitan commented Nov 5, 2021

Do you have miktex installed? Have you tried removing miktex from the Windows path?

I have no idea why, but it turned out this was it for me - I moved Miktek to after .../Anaconda3/Library/bin in the PATH (which I needed to add to fix a numpy import in Pycharm the first place) and this fixed the Qt5Agg use in matplotlib. Strange. None of these PATH machinations were necessary previously...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests