prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Impossible to build with matplotlib 3.3 on Python 3.7 and 3.8
  ## Description of the issue
  
  Trying a simple program main.py
  ```python
  import matplotlib.pyplot as plt
  
  plt.plot([0,1,2], [0,1,1])
  ```
  
  Running the application created with pyinstaller --hiddenimport='pkg_resources.py2_warn'  main.py
  
  I get:
  
  ```
  Traceback (most recent call last):                                                                                                                                                                                                                                                                                             File "main.py", line 3, in <module>                                                                                                                                                                                                                                                                                          File "<frozen importlib._bootstrap>", line 983, in _find_and_load                                                                                                                                                                                                                                                            File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked                                                                                                                                                                                                                                                   File "<frozen importlib._bootstrap>", line 677, in _load_unlocked                                                                                                                                                                                                                                                            File "c:\users\***\appdata\local\programs\python\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module                                                                                                                                                                              File "site-packages\matplotlib\__init__.py", line 898, in <module>                                                                                                                                                                                                                                                           File "site-packages\matplotlib\cbook\__init__.py", line 480, in _get_data_path                                                                                                                                                                                                                                               File "site-packages\matplotlib\__init__.py", line 239, in wrapper                                                                                                                                                                                                                                                            File "site-packages\matplotlib\__init__.py", line 534, in get_data_path                                                                                                                                                                                                                                                      File "site-packages\matplotlib\__init__.py", line 239, in wrapper                                                                                                                                                                                                                                                            File "site-packages\matplotlib\__init__.py", line 563, in _get_data_path                                                                                                                                                                                                                                                   NameError: name 'defaultParams' is not defined                                                                                                                                                                                                                                                                               [3064] Failed to execute script main
  ```
  ## Context information (for bug reports)
  
  * Output of `pyinstaller --version`: ```3.6 and 4.0-dev0```
  * Version of Python: 3.7 and 3.8
  * Platform: Windows (english 10)
  * Did you also try this on another platform? No
  
  ## What solves it
  
  Reverting to matplotlib 3.2.2 resolve the issue (temporarily).
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `PyInstaller/hooks/hook-matplotlib.py`
  Content:
  ```
  1 #-----------------------------------------------------------------------------
  2 # Copyright (c) 2013-2020, PyInstaller Development Team.
  3 #
  4 # Distributed under the terms of the GNU General Public License (version 2
  5 # or later) with exception for distributing the bootloader.
  6 #
  7 # The full license is in the file COPYING.txt, distributed with this software.
  8 #
  9 # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
  10 #-----------------------------------------------------------------------------
  11 
  12 
  13 from PyInstaller.utils.hooks import exec_statement
  14 
  15 mpl_data_dir = exec_statement(
  16     "import matplotlib; print(matplotlib._get_data_path())")
  17 
  18 datas = [
  19     (mpl_data_dir, "mpl-data"),
  20 ]
  21
  ```
  
  Path: `PyInstaller/hooks/rthooks/pyi_rth_mpldata.py`
  Content:
  ```
  1 #-----------------------------------------------------------------------------
  2 # Copyright (c) 2013-2020, PyInstaller Development Team.
  3 #
  4 # Licensed under the Apache License, Version 2.0 (the "License");
  5 # you may not use this file except in compliance with the License.
  6 #
  7 # The full license is in the file COPYING.txt, distributed with this software.
  8 #
  9 # SPDX-License-Identifier: Apache-2.0
  10 #-----------------------------------------------------------------------------
  11 
  12 
  13 import os
  14 import sys
  15 
  16 os.environ["MATPLOTLIBDATA"] = os.path.join(sys._MEIPASS, "mpl-data")
  17
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/PyInstaller/hooks/hook-matplotlib.py b/PyInstaller/hooks/hook-matplotlib.py
  --- a/PyInstaller/hooks/hook-matplotlib.py
  +++ b/PyInstaller/hooks/hook-matplotlib.py
  @@ -16,5 +16,5 @@
       "import matplotlib; print(matplotlib._get_data_path())")
   
   datas = [
  -    (mpl_data_dir, "mpl-data"),
  +    (mpl_data_dir, "matplotlib/mpl-data"),
   ]
  diff --git a/PyInstaller/hooks/rthooks/pyi_rth_mpldata.py b/PyInstaller/hooks/rthooks/pyi_rth_mpldata.py
  deleted file mode 100644
  --- a/PyInstaller/hooks/rthooks/pyi_rth_mpldata.py
  +++ /dev/null
  @@ -1,16 +0,0 @@
  -#-----------------------------------------------------------------------------
  -# Copyright (c) 2013-2020, PyInstaller Development Team.
  -#
  -# Licensed under the Apache License, Version 2.0 (the "License");
  -# you may not use this file except in compliance with the License.
  -#
  -# The full license is in the file COPYING.txt, distributed with this software.
  -#
  -# SPDX-License-Identifier: Apache-2.0
  -#-----------------------------------------------------------------------------
  -
  -
  -import os
  -import sys
  -
  -os.environ["MATPLOTLIBDATA"] = os.path.join(sys._MEIPASS, "mpl-data")
  
verification_info: {"golden_diff": "diff --git a/PyInstaller/hooks/hook-matplotlib.py b/PyInstaller/hooks/hook-matplotlib.py\n--- a/PyInstaller/hooks/hook-matplotlib.py\n+++ b/PyInstaller/hooks/hook-matplotlib.py\n@@ -16,5 +16,5 @@\n     \"import matplotlib; print(matplotlib._get_data_path())\")\n \n datas = [\n-    (mpl_data_dir, \"mpl-data\"),\n+    (mpl_data_dir, \"matplotlib/mpl-data\"),\n ]\ndiff --git a/PyInstaller/hooks/rthooks/pyi_rth_mpldata.py b/PyInstaller/hooks/rthooks/pyi_rth_mpldata.py\ndeleted file mode 100644\n--- a/PyInstaller/hooks/rthooks/pyi_rth_mpldata.py\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#-----------------------------------------------------------------------------\n-# Copyright (c) 2013-2020, PyInstaller Development Team.\n-#\n-# Licensed under the Apache License, Version 2.0 (the \"License\");\n-# you may not use this file except in compliance with the License.\n-#\n-# The full license is in the file COPYING.txt, distributed with this software.\n-#\n-# SPDX-License-Identifier: Apache-2.0\n-#-----------------------------------------------------------------------------\n-\n-\n-import os\n-import sys\n-\n-os.environ[\"MATPLOTLIBDATA\"] = os.path.join(sys._MEIPASS, \"mpl-data\")\n", "issue": "Impossible to build with matplotlib 3.3 on Python 3.7 and 3.8\n## Description of the issue\r\n\r\nTrying a simple program main.py\r\n```python\r\nimport matplotlib.pyplot as plt\r\n\r\nplt.plot([0,1,2], [0,1,1])\r\n```\r\n\r\nRunning the application created with pyinstaller --hiddenimport='pkg_resources.py2_warn'  main.py\r\n\r\nI get:\r\n\r\n```\r\nTraceback (most recent call last):                                                                                                                                                                                                                                                                                             File \"main.py\", line 3, in <module>                                                                                                                                                                                                                                                                                          File \"<frozen importlib._bootstrap>\", line 983, in _find_and_load                                                                                                                                                                                                                                                            File \"<frozen importlib._bootstrap>\", line 967, in _find_and_load_unlocked                                                                                                                                                                                                                                                   File \"<frozen importlib._bootstrap>\", line 677, in _load_unlocked                                                                                                                                                                                                                                                            File \"c:\\users\\***\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\PyInstaller\\loader\\pyimod03_importers.py\", line 623, in exec_module                                                                                                                                                                              File \"site-packages\\matplotlib\\__init__.py\", line 898, in <module>                                                                                                                                                                                                                                                           File \"site-packages\\matplotlib\\cbook\\__init__.py\", line 480, in _get_data_path                                                                                                                                                                                                                                               File \"site-packages\\matplotlib\\__init__.py\", line 239, in wrapper                                                                                                                                                                                                                                                            File \"site-packages\\matplotlib\\__init__.py\", line 534, in get_data_path                                                                                                                                                                                                                                                      File \"site-packages\\matplotlib\\__init__.py\", line 239, in wrapper                                                                                                                                                                                                                                                            File \"site-packages\\matplotlib\\__init__.py\", line 563, in _get_data_path                                                                                                                                                                                                                                                   NameError: name 'defaultParams' is not defined                                                                                                                                                                                                                                                                               [3064] Failed to execute script main\r\n```\r\n## Context information (for bug reports)\r\n\r\n* Output of `pyinstaller --version`: ```3.6 and 4.0-dev0```\r\n* Version of Python: 3.7 and 3.8\r\n* Platform: Windows (english 10)\r\n* Did you also try this on another platform? No\r\n\r\n## What solves it\r\n\r\nReverting to matplotlib 3.2.2 resolve the issue (temporarily).\n", "before_files": [{"content": "#-----------------------------------------------------------------------------\n# Copyright (c) 2013-2020, PyInstaller Development Team.\n#\n# Distributed under the terms of the GNU General Public License (version 2\n# or later) with exception for distributing the bootloader.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n#\n# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)\n#-----------------------------------------------------------------------------\n\n\nfrom PyInstaller.utils.hooks import exec_statement\n\nmpl_data_dir = exec_statement(\n    \"import matplotlib; print(matplotlib._get_data_path())\")\n\ndatas = [\n    (mpl_data_dir, \"mpl-data\"),\n]\n", "path": "PyInstaller/hooks/hook-matplotlib.py"}, {"content": "#-----------------------------------------------------------------------------\n# Copyright (c) 2013-2020, PyInstaller Development Team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n#\n# SPDX-License-Identifier: Apache-2.0\n#-----------------------------------------------------------------------------\n\n\nimport os\nimport sys\n\nos.environ[\"MATPLOTLIBDATA\"] = os.path.join(sys._MEIPASS, \"mpl-data\")\n", "path": "PyInstaller/hooks/rthooks/pyi_rth_mpldata.py"}], "after_files": [{"content": "#-----------------------------------------------------------------------------\n# Copyright (c) 2013-2020, PyInstaller Development Team.\n#\n# Distributed under the terms of the GNU General Public License (version 2\n# or later) with exception for distributing the bootloader.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n#\n# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)\n#-----------------------------------------------------------------------------\n\n\nfrom PyInstaller.utils.hooks import exec_statement\n\nmpl_data_dir = exec_statement(\n    \"import matplotlib; print(matplotlib._get_data_path())\")\n\ndatas = [\n    (mpl_data_dir, \"matplotlib/mpl-data\"),\n]\n", "path": "PyInstaller/hooks/hook-matplotlib.py"}, {"content": null, "path": "PyInstaller/hooks/rthooks/pyi_rth_mpldata.py"}]}