<p dir="auto"><strong>Bug summary</strong><br>
When using Pyinstaller in version 3.3.1, I get an error message that "defaultParams" is not defined.<br>
The dictionary is located in __ init __.py @ line # 563 (Version 3.3.1).</p>
<p dir="auto">In Version 3.2.2, "defaultParams" was imported from rcsetup at beginning of file, but in version 3.3.1 it is not present</p>
<p dir="auto">Version 3.2.2 ==&gt; <strong>from matplotlib.rcsetup import defaultParams, validate_backend, cycler</strong><br>
Version 3.3.1 ==&gt; <strong>from matplotlib.rcsetup import validate_backend, cycler</strong></p>
<p dir="auto">The only other location where  "defaultParams"  can be brought into __ init __.py is @ line # 916, but maybe it is too far down for program to see.</p>
<p dir="auto">I tried adding the import back, but does not work :)</p>
<p dir="auto"><strong>Code for reproduction</strong><br>
No code, just regular freezing in Pyinstaller</p>
<p dir="auto"><strong>Actual outcome</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 983, in _find_and_load
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 967, in _find_and_load_unlocked
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 677, in _load_unlocked
  File &quot;c:\python37-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py&quot;, line 493, in exec_module
    exec(bytecode, module.__dict__)
  File &quot;matplotlib\__init__.py&quot;, line 905, in &lt;module&gt;
  File &quot;matplotlib\cbook\__init__.py&quot;, line 480, in _get_data_path
  File &quot;matplotlib\__init__.py&quot;, line 239, in wrapper
  File &quot;matplotlib\__init__.py&quot;, line 534, in get_data_path
  File &quot;matplotlib\__init__.py&quot;, line 239, in wrapper
  File &quot;matplotlib\__init__.py&quot;, line 563, in _get_data_path
NameError: name 'defaultParams' is not defined"><pre class="notranslate"><code class="notranslate">  File "&lt;frozen importlib._bootstrap&gt;", line 983, in _find_and_load
  File "&lt;frozen importlib._bootstrap&gt;", line 967, in _find_and_load_unlocked
  File "&lt;frozen importlib._bootstrap&gt;", line 677, in _load_unlocked
  File "c:\python37-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
    exec(bytecode, module.__dict__)
  File "matplotlib\__init__.py", line 905, in &lt;module&gt;
  File "matplotlib\cbook\__init__.py", line 480, in _get_data_path
  File "matplotlib\__init__.py", line 239, in wrapper
  File "matplotlib\__init__.py", line 534, in get_data_path
  File "matplotlib\__init__.py", line 239, in wrapper
  File "matplotlib\__init__.py", line 563, in _get_data_path
NameError: name 'defaultParams' is not defined
</code></pre></div>

<ul dir="auto">
<li>Operating system: Win 10</li>
<li>Matplotlib version:  3.3.1</li>
<li>Matplotlib backend (<code class="notranslate">print(matplotlib.get_backend())</code>): matplotlib.backends.backend_qt5agg</li>
<li>Python version: 3.7.7</li>
<li>Other libraries: PyQt5: 5.15.0</li>
</ul>
<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>

<p dir="auto">I try to plot some dataframe with matplotlib in a GUI designed by pyqt5. I use <code class="notranslate">pyinstaller</code> for packaging as following:</p>
<p dir="auto"><code class="notranslate"> pyinstaller main.py</code></p>
<p dir="auto">and its outcome:</p>
<blockquote>
<p dir="auto">33 INFO: PyInstaller: 3.4<br>
34 INFO: Python: 3.6.9<br>
34 INFO: Platform: Linux-5.4.0-42-generic-x86_64-with-Ubuntu-18.04-bionic<br>
35 INFO: wrote /home/shahriar/python_projects/first_test/src/main/python/main.spec<br>
36 INFO: UPX is not available.<br>
37 INFO: Extending PYTHONPATH with paths<br>
['/home/shahriar/python_projects/first_test/src/main/python',<br>
'/home/shahriar/python_projects/first_test/src/main/python']<br>
38 INFO: checking Analysis<br>
58 INFO: Building because /home/shahriar/python_projects/first_test/src/main/python/main.py changed<br>
59 INFO: Initializing module dependency graph...<br>
60 INFO: Initializing module graph hooks...<br>
61 INFO: Analyzing base_library.zip ...<br>
2440 INFO: running Analysis Analysis-00.toc<br>
2485 INFO: Caching module hooks...<br>
2490 INFO: Analyzing /home/shahriar/python_projects/first_test/src/main/python/main.py<br>
3151 INFO: Processing pre-find module path hook   distutils<br>
3996 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves<br>
4263 INFO: Processing pre-find module path hook   site<br>
4263 INFO: site: retargeting to fake-dir '/home/shahriar/first_test/lib/python3.6/site-packages/PyInstaller/fake-modules'<br>
8256 INFO: Processing pre-safe import module hook   six.moves<br>
22239 INFO: Loading module hooks...<br>
22239 INFO: Loading module hook "hook-sqlite3.py"...<br>
22285 INFO: Loading module hook "hook-scipy.py"...<br>
22286 INFO: Loading module hook "hook-distutils.py"...<br>
22286 INFO: Loading module hook "hook-scipy.sparse.csgraph.py"...<br>
22289 INFO: Loading module hook "hook-scipy.linalg.py"...<br>
22290 INFO: Loading module hook "hook-PyQt5.QtGui.py"...<br>
22385 INFO: Loading module hook "hook-PyQt5.py"...<br>
22400 INFO: Loading module hook "hook-numpy.core.py"...<br>
22529 INFO: Loading module hook "hook-PyQt5.QtCore.py"...<br>
22555 INFO: Loading module hook "hook-encodings.py"...<br>
22607 INFO: Loading module hook "hook-matplotlib.py"...<br>
22878 INFO: Loading module hook "hook-PIL.Image.py"...<br>
23238 INFO: Loading module hook "hook-pycparser.py"...<br>
23239 INFO: Loading module hook "hook-lib2to3.py"...<br>
23240 INFO: Loading module hook "hook-sysconfig.py"...<br>
23245 INFO: Loading module hook "hook-numpy.py"...<br>
23246 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...<br>
23246 INFO: Loading module hook "hook-pkg_resources.py"...<br>
23589 INFO: Processing pre-safe import module hook   win32com<br>
23631 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...<br>
23702 INFO: Loading module hook "hook-pytz.py"...<br>
23722 INFO: Loading module hook "hook-scipy.special._ufuncs.py"...<br>
23722 INFO: Loading module hook "hook-pydoc.py"...<br>
23723 INFO: Loading module hook "hook-_tkinter.py"...<br>
23804 INFO: checking Tree<br>
23808 INFO: checking Tree<br>
23809 INFO: Loading module hook "hook-setuptools.py"...<br>
/home/shahriar/first_test/lib/python3.6/site-packages/setuptools/distutils_patch.py:26: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.<br>
"Distutils was imported before Setuptools. This usage is discouraged "<br>
24243 INFO: Loading module hook "hook-scipy.special._ellip_harm_2.py"...<br>
24244 INFO: Loading module hook "hook-matplotlib.backends.py"...<br>
24998 INFO:   Matplotlib backend "GTK3Agg": ignored<br>
The GTK3 backends require PyGObject<br>
25466 INFO:   Matplotlib backend "GTK3Cairo": ignored<br>
The GTK3 backends require PyGObject<br>
25726 INFO:   Matplotlib backend "MacOSX": ignored<br>
cannot import name '_macosx'<br>
25991 INFO:   Matplotlib backend "nbAgg": ignored<br>
No module named 'IPython'<br>
-c:12: MatplotlibDeprecationWarning:<br>
The matplotlib.backends.backend_qt4agg backend was deprecated in Matplotlib 3.3 and will be removed two minor releases later.<br>
26478 INFO:   Matplotlib backend "Qt4Agg": added<br>
-c:12: MatplotlibDeprecationWarning:<br>
The matplotlib.backends.backend_qt4cairo backend was deprecated in Matplotlib 3.3 and will be removed two minor releases later.<br>
27028 INFO:   Matplotlib backend "Qt4Cairo": added<br>
27514 INFO:   Matplotlib backend "Qt5Agg": added<br>
28063 INFO:   Matplotlib backend "Qt5Cairo": added<br>
28495 INFO:   Matplotlib backend "TkAgg": added<br>
28964 INFO:   Matplotlib backend "TkCairo": added<br>
29231 INFO:   Matplotlib backend "WebAgg": ignored<br>
Traceback (most recent call last):<br>
File "/home/shahriar/first_test/lib/python3.6/site-packages/matplotlib/backends/backend_webagg.py", line 27, in <br>
import tornado<br>
ModuleNotFoundError: No module named 'tornado'</p>
<p dir="auto">The above exception was the direct cause of the following exception:</p>
<p dir="auto">Traceback (most recent call last):<br>
File "", line 12, in <br>
File "/home/shahriar/first_test/lib/python3.6/site-packages/matplotlib/backends/backend_webagg.py", line 29, in <br>
raise RuntimeError("The WebAgg backend requires Tornado.") from err<br>
RuntimeError: The WebAgg backend requires Tornado.<br>
29649 INFO:   Matplotlib backend "WX": ignored<br>
No module named 'wx'<br>
29910 INFO:   Matplotlib backend "WXAgg": ignored<br>
No module named 'wx'<br>
30179 INFO:   Matplotlib backend "WXCairo": ignored<br>
No module named 'wx'<br>
30505 INFO:   Matplotlib backend "agg": added<br>
30868 INFO:   Matplotlib backend "cairo": added<br>
31301 INFO:   Matplotlib backend "pdf": added<br>
31727 INFO:   Matplotlib backend "pgf": added<br>
32083 INFO:   Matplotlib backend "ps": added<br>
32430 INFO:   Matplotlib backend "svg": added<br>
32847 INFO:   Matplotlib backend "template": added<br>
33202 INFO: Loading module hook "hook-PIL.py"...<br>
33205 INFO: Excluding import 'PyQt4'<br>
33207 INFO: Excluding import 'tkinter'<br>
33210 INFO:   Removing import of tkinter from module PIL.ImageTk<br>
33211 INFO: Excluding import 'PySide'<br>
33214 INFO: Import to be excluded not found: 'FixTk'<br>
33215 INFO: Excluding import 'PyQt5'<br>
33217 INFO:   Removing import of PyQt5.QtCore from module PIL.ImageQt<br>
33217 INFO:   Removing import of PyQt5.QtGui from module PIL.ImageQt<br>
33217 INFO: Loading module hook "hook-xml.py"...<br>
33261 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...<br>
33263 INFO: Import to be excluded not found: 'FixTk'<br>
33263 INFO: Excluding import 'tkinter'<br>
33264 INFO: Loading module hook "hook-pandas.py"...<br>
33994 INFO: Looking for ctypes DLLs<br>
34103 WARNING: library user32 required via ctypes not found<br>
34214 WARNING: library msvcrt required via ctypes not found<br>
34235 INFO: Analyzing run-time hooks ...<br>
34249 INFO: Including run-time hook 'pyi_rth_pkgres.py'<br>
34250 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'<br>
34253 INFO: Including run-time hook 'pyi_rth__tkinter.py'<br>
34254 INFO: Including run-time hook 'pyi_rth_mplconfig.py'<br>
34255 INFO: Including run-time hook 'pyi_rth_mpldata.py'<br>
34256 INFO: Including run-time hook 'pyi_rth_qt5.py'<br>
34284 INFO: Looking for dynamic libraries<br>
37779 INFO: Looking for eggs<br>
37780 INFO: Python library not in binary dependencies. Doing additional searching...<br>
37800 INFO: Using Python library /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0<br>
37826 INFO: Warnings written to /home/shahriar/python_projects/first_test/src/main/python/build/main/warn-main.txt<br>
37958 INFO: Graph cross-reference written to /home/shahriar/python_projects/first_test/src/main/python/build/main/xref-main.html<br>
38033 INFO: checking PYZ<br>
38046 INFO: Building because toc changed<br>
38047 INFO: Building PYZ (ZlibArchive) /home/shahriar/python_projects/first_test/src/main/python/build/main/PYZ-00.pyz<br>
40255 INFO: Building PYZ (ZlibArchive) /home/shahriar/python_projects/first_test/src/main/python/build/main/PYZ-00.pyz completed successfully.<br>
40295 INFO: checking PKG<br>
40296 INFO: Building because toc changed<br>
40296 INFO: Building PKG (CArchive) PKG-00.pkg<br>
40460 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.<br>
40462 INFO: Bootloader /home/shahriar/first_test/lib/python3.6/site-packages/PyInstaller/bootloader/Linux-64bit/run<br>
40462 INFO: checking EXE<br>
40464 INFO: Building because toc changed<br>
40464 INFO: Building EXE from EXE-00.toc<br>
40466 INFO: Appending archive to ELF section in EXE /home/shahriar/python_projects/first_test/src/main/python/build/main/main<br>
40659 INFO: Building EXE from EXE-00.toc completed successfully.<br>
40665 INFO: checking COLLECT<br>
WARNING: The output directory "/home/shahriar/python_projects/first_test/src/main/python/dist/main" and ALL ITS CONTENTS will be REMOVED! Continue? (y/n)y<br>
110470 INFO: Removing dir /home/shahriar/python_projects/first_test/src/main/python/dist/main<br>
110556 INFO: Building COLLECT COLLECT-00.toc<br>
111044 INFO: Building COLLECT COLLECT-00.toc completed successfully.</p>
</blockquote>
<p dir="auto"><strong>Actual outcome</strong></p>

<p dir="auto">when I run the executable file as <code class="notranslate">./dist/main</code>, I get this error:</p>
<blockquote>
<p dir="auto">/home/shahriar/first_test/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py:627: MatplotlibDeprecationWarning: Matplotlib installs where the data is not in the mpl-data subdirectory of the package are deprecated since 3.2 and support for them will be removed two minor releases later.<br>
exec(bytecode, module.<strong>dict</strong>)<br>
Traceback (most recent call last):<br>
File "main.py", line 20, in <br>
from matplotlib import ticker<br>
File "", line 971, in _find_and_load<br>
File "", line 955, in _find_and_load_unlocked<br>
File "", line 665, in _load_unlocked<br>
File "/home/shahriar/first_test/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 627, in exec_module<br>
exec(bytecode, module.<strong>dict</strong>)<br>
File "matplotlib/<strong>init</strong>.py", line 898, in <br>
File "matplotlib/cbook/<strong>init</strong>.py", line 480, in _get_data_path<br>
File "matplotlib/<strong>init</strong>.py", line 239, in wrapper<br>
File "matplotlib/<strong>init</strong>.py", line 534, in get_data_path<br>
File "matplotlib/<strong>init</strong>.py", line 239, in wrapper<br>
File "matplotlib/<strong>init</strong>.py", line 563, in _get_data_path<br>
NameError: name 'defaultParams' is not defined<br>
[24669] Failed to execute script main</p>
</blockquote>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# If applicable, paste the console output here
#
#"><pre class="notranslate"><code class="notranslate"># If applicable, paste the console output here
#
#
</code></pre></div>
<p dir="auto"><strong>Expected outcome</strong></p>
<p dir="auto">an executable file of my project</p>


<p dir="auto"><strong>Matplotlib version</strong></p>

<ul dir="auto">
<li>Operating system: ubuntu 18.04</li>
<li>Matplotlib version: 3.3.0</li>
<li>Matplotlib backend (<code class="notranslate">print(matplotlib.get_backend())</code>):Backend Qt5Agg is interactive backend. Turning interactive mode on. Qt5Agg</li>
<li>Python version:3.6.9</li>
<li>Jupyter version (if applicable):</li>
<li>Other libraries: pyqt5, pyinstaller, pandas</li>
</ul>