<div dir="ltr"><div><div><div><div>Just to make absolutely clear, you set the default backend in your matplotlibrc file to "agg" and it still hung on you? If that is the case, then the problem isn't tkinter.<br><br></div>Some possibilities are<br><br>1) a massive font database that matplotlib is trying to build a cache for<br></div>2) import of matplotlib from somewhere else unexpected (which would explain pycharm's behavior), and that file/module is misbehaving. We have seen instances in the past where users would name their plotting porting of their code "matplotlib.py" or "pylab.py" or some such, and then start to wonder why their code doesn't work properly.<br><br></div>Have you looked to see if there are other programs that are running during the import stage? One thing matplotlib does for the first import is to create a font cache, and it does this by using some fc-list program, iirc. This can take a long time on some machines that have adobe's font collection installed, for example, but that is usually a Windows thing....<br><br></div>Ben Root<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 6, 2017 at 4:09 PM, Andrew Z <span dir="ltr"><<a href="mailto:formisc@gmail.com" target="_blank">formisc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>Tkinter was most likely installed as part of rpm install.</div><div dir="auto">Backends - not really. I do know that with mpld3and agg  the scripts hang.</div><div dir="auto">Ihave reinstalled matplot using rpm ( rpm comes only in 1.5 version) and with pip3.</div><div dir="auto">Today i tried on the office machine (fedora 25). Rpm brings only matplot1.5.</div><div dir="auto"><br></div><div dir="auto">maybe 2 installed locally using pip3 messes with 1.5 leftover or libraries.</div><div dir="auto">Not sure how to validate this idea though..</div><div dir="auto">Probably unrelated:</div><div dir="auto">In pycharm pyplot is not been recognized as part of matplotlib when i "import matplotlib.pyplot. yet the script doesnt crash on import statement...</div><div><div class="h5"><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On Nov 6, 2017 15:13, "Benjamin Root" <<a href="mailto:ben.v.root@gmail.com" target="_blank">ben.v.root@gmail.com</a>> wrote:<br type="attribution"><blockquote class="m_-4096754965026030501quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">How did you install Tkinter? Have you tested any other backends? Does this happen for just the head-less "Agg" backend set as default?<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div class="m_-4096754965026030501elided-text">On Sat, Nov 4, 2017 at 3:35 PM, Andrew Z <span dir="ltr"><<a href="mailto:formisc@gmail.com" target="_blank">formisc@gmail.com</a>></span> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-4096754965026030501elided-text"><div dir="ltr"><div><div><div>more relevant information:<br>[az@hp src]$ python3.5<br>Python 3.5.3 (default, May 11 2017, 09:10:41) <br>[GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux<br>Type "help", "copyright", "credits" or "license" for more information.<br>>>> import matplotlib<br>>>> matplotlib.__file__<br>'/home/az/.local/lib/python3.5<wbr>/site-packages/matplotlib/__in<wbr>it__.py'<br>>>> matplotlib.get_configdir()<br>'/home/az/.config/matplotlib'<br>>>> print(matplotlib.__version__)<br>2.1.0<br><br>now if i get the simplest plot :<br></div><br>[az@hp src]$ more ./main1.py <br>import matplotlib.pyplot as plt<br>print("imported")<br>plt.plot([1,2,4,1])<br>print("plot is done")<br>plt.show()<br>print("show is done")<br><br>[az@hp src]$ python3.5 main1.py --verbose-debug<br>$HOME=/home/az<br>matplotlib data path /home/az/.local/lib/python3.5/<wbr>site-packages/matplotlib/mpl-d<wbr>ata<br>loaded rc file /home/az/.local/lib/python3.5/<wbr>site-packages/matplotlib/mpl-d<wbr>ata/matplotlibrc<br>matplotlib version 2.1.0<br>verbose.level debug<br>interactive is False<br>platform is linux<br>loaded modules: ['_locale', 'urllib.request', 'numpy.lib.shape_base', 'numpy.matrixlib', 'ipaddress', 'hashlib', 'collections', 'numpy.lib.financial', 'atexit', 'numpy.lib._iotools', '_frozen_importlib_external', 'numpy.polynomial.chebyshev', 'six', 'unittest.runner', '_sitebuiltins', 'numpy.compat', 'numpy.ma.core', 'abrt_exception_handler3', 'codecs', 'sre_constants', 'calendar', 'matplotlib.cbook', 'contextlib', 'heapq', 'ssl', 'dis', 'binascii', 'posixpath', 'cython_runtime', 'traceback', 'numpy.polynomial.laguerre', '_hashlib', 'zipimport', 'email.utils', '_functools', 'copyreg', 'sys', '_sre', 'matplotlib.cbook._backports', 'numpy.lib.arraysetops', 'random', 'email.parser', 'numpy.fft.helper', '_collections', 'difflib', 'numpy.lib.scimath', 'unittest', '_sysconfigdata', 'numpy', 'site', '_ast', 'json.scanner', 'os', 'http', 'functools', 'unittest.main', '<a href="http://numpy.linalg.info" target="_blank">numpy.linalg.info</a>', '_heapq', 'token', 'pathlib', 'tokenize', 'cycler', 'encodings.cp437', 'numpy.polynomial.polynomial', 'numpy.polynomial._polybase', 'numpy.lib.mixins', 'ctypes._endian', 'numpy.lib.arraypad', 'numpy.matrixlib.defmatrix', 'distutils.version', '_signal', 'marshal', 'stat', 'pprint', 'base64', 'logging', 'enum', 'selectors', 'numpy.core', 'json.encoder', 'operator', 'numpy.testing.nosetester', 'matplotlib._version', 'numpy.ctypeslib', 'numpy.add_newdocs', 'unittest.util', '_weakref', 'select', 'importlib._bootstrap_external<wbr>', 'mtrand', 'importlib._bootstrap', 'matplotlib.rcsetup', 'matplotlib.colors', 'numpy.testing.decorators', 'json', 'numpy.core.machar', 'email.encoders', 'six.moves.urllib', 'matplotlib', 'keyword', 'errno', 'numpy.lib.stride_tricks', '_socket', 'email.quoprimime', 'numpy.ma.extras', 'numbers', 'numpy.version', '_bisect', '_string', 'numpy.lib.arrayterator', 'numpy.core.umath', 'numpy.lib', '_thread', 'time', '_frozen_importlib', '<a href="http://numpy.core.info" target="_blank">numpy.core.info</a>', 'numpy.core.multiarray', 'math', '_opcode', 'urllib.parse', 'distutils.sysconfig', 'ntpath', 'argparse', 'types', 'sre_compile', 'glob', '__main__', 'email._encoded_words', 'socket', '_struct', '<a href="http://numpy.fft.info" target="_blank">numpy.fft.info</a>', 'unittest.signals', 'numpy.lib.npyio', 'grp', 'urllib.error', '_io', 'numpy._globals', 'gettext', 'numpy.compat.py3k', 'distutils', 'email.charset', 'ast', 'numpy.lib.function_base', 'uu', 'encodings', 'urllib', 'numpy.lib.twodim_base', 'encodings.latin_1', 'tempfile', 'numpy.lib._version', 'numpy.polynomial.polyutils', 'quopri', 'os.path', '_imp', 'email.base64mime', 'email.message', 'email.header', 'opcode', 'encodings.utf_8', 'reprlib', '_stat', '_warnings', 'email.feedparser', 'numpy.testing.utils', 'numpy.lib.utils', 'genericpath', 'numpy.polynomial.hermite', '_compat_pickle', 'bz2', '_compression', 'subprocess', '_json', 'numpy.lib.nanfunctions', 'inspect', 'sysconfig', '_operator', 'shutil', 'pwd', 'warnings', '_ctypes', '_random', 'email.iterators', '_collections_abc', '__future__', 'email', 'numpy._distributor_init', 'unittest.loader', '_bootlocale', 'numpy.core.records', 'fnmatch', '_posixsubprocess', 'numpy._import_tools', 'numpy.lib.format', '_lzma', 'numpy.core.arrayprint', 'json.decoder', 'signal', 'gzip', 'posix', 'textwrap', 'numpy.fft.fftpack', 'importlib.machinery', 'lzma', 'struct', 'pickle', '_codecs', 'numpy.core.einsumfunc', 'itertools', 'numpy.core.shape_base', 'encodings.aliases', 'numpy.lib.index_tricks', '<a href="http://numpy.random.info" target="_blank">numpy.random.info</a>', 'numpy.linalg._umath_linalg', 'matplotlib.fontconfig_pattern<wbr>', 'six.moves.urllib.request', '_weakrefset', 'distutils.errors', 'io', 'locale', 'email.errors', 'numpy.core.numerictypes', 'numpy.compat._inspect', 'zlib', 'numpy.polynomial.hermite_e', 'numpy.lib.type_check', 'mpl_toolkits', 'numpy.fft.fftpack_lite', 'bisect', 'dateutil', 'numpy.polynomial', 'collections.abc', '_bz2', 'weakref', 'numpy.lib.ufunclike', 'numpy.core.function_base', 'abc', 'six.moves', 'numpy.linalg', 'numpy.polynomial.legendre', 'numpy.core.defchararray', 'numpy.linalg.lapack_lite', 'numpy.core._internal', 'importlib', 'unittest.suite', 'unittest.case', 'numpy.core.memmap', 'email._parseaddr', '_pickle', '_ssl', 'matplotlib.compat.subprocess'<wbr>, 'numpy.random', 'datetime', 'email._policybase', 'sre_parse', 'numpy.linalg.linalg', 'copy', 'numpy.lib._datasource', 'numpy.core._methods', 'linecache', 'matplotlib.compat', 'numpy.testing', 'numpy.__config__', 'unittest.result', 're', 'http.client', '<a href="http://numpy.lib.info" target="_blank">numpy.lib.info</a>', 'numpy.core.fromnumeric', 'numpy.core.getlimits', 'matplotlib._color_data', 'urllib.response', 'pyparsing', 'numpy.lib.polynomial', 'threading', 'string', 'numpy.core.numeric', '<a href="http://numpy.ma" target="_blank">numpy.ma</a>', 'numpy.fft', 'ctypes', 'numpy.random.mtrand', 'matplotlib.cbook.deprecation'<wbr>, '_datetime', 'builtins']<br>CACHEDIR=/home/az/.cache/matpl<wbr>otlib<br>Using fontManager instance from /home/az/.cache/matplotlib/fon<wbr>tList.json<br>backend TkAgg version 8.6<br>imported<br>^C<br></div>Hangs at this point with CPU @ 100%<br><br>grep -v '#' /home/az/.local/lib/python3.5/<wbr>site-packages/matplotlib/mpl-d<wbr>ata/matplotlibrc<br><br></div>The only line is :<br><div>backend      : TkAgg<br><div><div><br><br>[az@hp src]$ gcc --version<br>gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)<br><br></div><div>I installed using pip3 into --user directory.<br></div><div>but i also remember that i used dnf to get tkInnter installed:<br>rpm -qa | grep tkin<br>python3-tkinter-3.5.3-6.fc24.x<wbr>86_64<br>tkinter-2.7.13-2.fc24.x86_64<br>tix-1:8.4.3-17.fc24.x86_64</div>if i were to compare "pip3 list" between system (root) and the user (az):<br>diff -u /tmp/root_pip /tmp/usr_pip <br>--- /tmp/root_pip    2017-11-04 15:26:09.612643559 -0400<br>+++ /tmp/usr_pip    2017-11-04 15:25:52.396473226 -0400<br>@@ -1,39 +1,65 @@<br> astroid (1.4.5)<br> beautifulsoup4 (4.6.0)<br>+bleach (2.1)<br> blivet (1.20.3)<br> chardet (2.2.1)<br> coverage (4.4.1)<br> cssselect (0.9.1)<br> cupshelpers (1.0)<br>+cx-Oracle (6.0.2)<br> cycler (0.10.0)<br> decorator (4.0.11)<br> distro (1.0.2)<br> dnf-langpacks (0.15.1)<br>+entrypoints (0.2.3)<br> fros (1.1)<br>-html5lib (0.999)<br>+html5lib (1.0b10)<br> humanize (0.5.1)<br> ib-insync (0.8.5)<br>+ibapi (9.73.2)<br> iniparse (0.4)<br> initial-setup (0.3.40)<br> IPy (0.81)<br>+ipykernel (4.6.1)<br>+ipython (6.2.0)<br>+ipython-genutils (0.2.0)<br> ipywidgets (7.0.0)<br> isc (1.0)<br> javapackages (4.6.0)<br>+jedi (0.11.0)<br>+Jinja2 (2.9.6)<br>+jsonschema (2.6.0)<br> jupyter (1.0.0)<br>+jupyter-client (5.1.0)<br>+jupyter-console (5.2.0)<br>+jupyter-core (4.3.0)<br> langtable (0.0.35)<br> lazy-object-proxy (1.2.1)<br> lxml (3.7.2)<br>+MarkupSafe (1.0)<br>+matplotlib (2.1.0)<br>+mistune (0.7.4)<br>+nbconvert (5.3.1)<br>+nbformat (4.4.0)<br>+notebook (5.1.0)<br> ntplib (0.3.3)<br> numpy (1.13.3)<br> ordered-set (2.0.0)<br> pandas (0.20.3)<br>+pandocfilters (1.4.2)<br>+parso (0.1.0)<br>+pexpect (4.2.1)<br>+pickleshare (0.7.4)<br> pid (2.0.1)<br> Pillow (3.2.0)<br> pip (9.0.1)<br>+prompt-toolkit (1.0.15)<br>+ptyprocess (0.5.2)<br> pwquality (1.3.0)<br> pycups (1.9.72)<br> pycurl (7.43.0)<br> pyenchant (1.6.8)<br>+Pygments (2.2.0)<br> pygobject (3.20.1)<br> pygpgme (0.3)<br> pyinotify (0.9.6)<br>@@ -42,6 +68,7 @@<br> pylint (1.5.6)<br> pyparsing (2.2.0)<br> pyparted (3.10.7)<br>+PyQt5 (5.9)<br> PySocks (1.5.6)<br> python-augeas (0.5.0)<br> python-dateutil (2.6.1)<br>@@ -50,6 +77,9 @@<br> pytz (2017.2)<br> pyudev (0.21.0)<br> pyxdg (0.25)<br>+pyzmq (16.0.2)<br>+qtconsole (4.3.1)<br>+Quamash (0.5.5)<br> requests (2.10.0)<br> requests-file (1.4)<br> requests-ftp (0.3.1)<br>@@ -60,11 +90,21 @@<br> sepolicy (1.1)<br> setroubleshoot (1.1)<br> setuptools (20.1.1)<br>+simplegeneric (0.8.1)<br>+sip (4.19.3)<br> six (1.11.0)<br> slip (0.6.4)<br> slip.dbus (0.6.4)<br> sos (3.2)<br> SSSDConfig (1.15.3)<br> systemd-python (232)<br>+terminado (0.6)<br>+testpath (0.3.1)<br>+tornado (4.5.2)<br>+traitlets (4.3.2)<br>+tws-async (0.5.5)<br> urllib3 (1.15.1)<br>+wcwidth (0.1.7)<br>+webencodings (0.5.1)<br>+widgetsnbextension (3.0.3)<br> wrapt (1.10.10)<br><br><br></div><div>I just removed html5lib from system(root) , but tha made no difference to the plotting..<br><br><br></div><div><div><br><br></div></div></div></div><div class="m_-4096754965026030501m_3559327845014582346HOEnZb"><div class="m_-4096754965026030501m_3559327845014582346h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 4, 2017 at 11:09 AM, Andrew Z <span dir="ltr"><<a href="mailto:formisc@gmail.com" target="_blank">formisc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>hello,<br></div> the issue i'm experiencing is local to my laptop ( the other machines i have run examples just fine).<br></div>I described it here <a href="https://www.mail-archive.com/python-list@python.org/msg432343.html" target="_blank">https://www.mail-archive.com/p<wbr>ython-list@python.org/msg43234<wbr>3.html</a> in details.<br></div>i searched around, but none of the proposed workarounds helped.<br><br></div>Is there a  way to enable some-kind of debugging or verbose output to see what exactly is happening behind the scene?<br><br></div>Thank you.<span class="m_-4096754965026030501m_3559327845014582346m_-7221700035694085032HOEnZb"><font color="#888888"><br></font></span></div><span class="m_-4096754965026030501m_3559327845014582346m_-7221700035694085032HOEnZb"><font color="#888888">AZ<br><div><div><div><div><br></div></div></div></div></font></span></div>
</blockquote></div><br></div>
</div></div><br></div>______________________________<wbr>_________________<br>
Matplotlib-users mailing list<br>
<a href="mailto:Matplotlib-users@python.org" target="_blank">Matplotlib-users@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/matplotlib-users" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/matplotlib-users</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div>