We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Some hooks should get fixed
<!--
Welcome to the PyInstaller issue tracker! Before creating an issue, please heed the following:

1. This tracker should only be used to report bugs and request features / enhancements to PyInstaller
    - For questions and general support, use the mailing list, see
	  <http://www.pyinstaller.org/support.html#mailing-list>
2. Use the search function before creating a new issue. Duplicates will be closed and directed to
   the original discussion.
3. When making a bug report, make sure you provide all required information. The easier it is for
   maintainers to reproduce, the faster it'll be fixed.
-->

<!-- +++ ONLY TEXT +++ DO NOT POST IMAGES +++ -->

## Description of the issue
It returns `ModuleNotFoundError: No module named '_sysconfigdata__win32_'` at `from sklearn.cluster import MiniBatchKMeans` for some reason


### Context information (for bug reports)

* Output of `pyinstaller --version`: ```4.5.1```
* Version of Python: ```Python 3.9.6```
* Platform: ```MSYS2 MINGW64```
* How you installed Python: ```from MSYS2, the MINGW64 one```
* Did you also try this on another platform? Does it work there? ```Nope```

* follow *all* the instructions in our "If Things Go Wrong" Guide
  (https://github.com/pyinstaller/pyinstaller/wiki/If-Things-Go-Wrong) and

### Make sure [everything is packaged correctly](https://github.com/pyinstaller/pyinstaller/wiki/How-to-Report-Bugs#make-sure-everything-is-packaged-correctly)

  * [x] start with clean installation
  * [ ] use the latest development version
  * [x] Run your frozen program **from a command window (shell)** — instead of double-clicking on it ```But it didn't catch the program, like it runs it in separate process. I use windowed mode, anyways```
  * [ ] Package your program in **--onedir mode**
  * [x] Package **without UPX**, say: use the option `--noupx` or set `upx=False` in your .spec-file
  * [x] Repackage you application in **verbose/debug mode**. For this, pass the option `--debug` to `pyi-makespec` or `pyinstaller` or use `EXE(..., debug=1, ...)` in your .spec file.


### A minimal example program which shows the error
#### window.py
```
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gio
import os
import gc
import numpy as np
import pandas as pd
from sklearn.cluster import MiniBatchKMeans
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA

@Gtk.Template(resource_path='/org/example/App/window.ui')
class ClusterifyWindow(Gtk.ApplicationWindow):
    __gtype_name__ = 'ClusterifyWindow'
    full_initialized = False

    ...

    def __init__(self, log_error, **kwargs):
        super().__init__(**kwargs)
        self.log_error = log_error

    @Gtk.Template.Callback()
    def on_ClusterifyWindow_focus_in_event(self, cb_widget, data):
        if not self.full_initialized:
            import matplotlib
            matplotlib.use("GTK3Cairo")
            import matplotlib.pyplot as plt
            import seaborn as sns
            sns.set()
            from matplotlib.backends.backend_gtk3cairo import FigureCanvasGTK3Cairo as FigureCanvas

            self.fi_clusters = plt.figure()
            self.cv_clusters = FigureCanvas(self.fi_clusters)
            self.cv_clusters.show_all()

            ...

        self.full_initialized = True
```

#### clusterify.spec
```
# -*- mode: python ; coding: utf-8 -*-

typelib_path = "C:/msys64/mingw64/lib/girepository-1.0"
block_cipher = None


a = Analysis(['C:/msys64/mingw64/bin/clusterify'],
             pathex=['C:/msys64/home/rivan/Clusterify'],
             binaries=[(os.path.join(typelib_path, tl), 'gi_typelibs') for tl in os.listdir(typelib_path)],
             datas=[],
             hiddenimports=['numpy',
                            'pandas',
                            'sklearn.cluster', 'sklearn.preprocessing', 'sklearn.decomposition',
                            'matplotlib', 'matplotlib.backends.backend_gtk3cairo',
                            'seaborn'],
             hookspath=[],
             hooksconfig={},
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)

exe = EXE(pyz,
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,  
          [],
          name='clusterify',
          debug=True,
          bootloader_ignore_signals=False,
          strip=False,
          upx=False,
          upx_exclude=[],
          runtime_tmpdir=None,
          console=False,
          disable_windowed_traceback=False,
          target_arch=None,
          codesign_identity=None,
          entitlements_file=None )
```

### Stacktrace / full error message
```
Traceback (most recent call last):
  File "clusterify", line 51, in <module>
  File "C:\msys64/mingw64/share/clusterify\clusterify\main.py", line 33, in <module>
    from .window import ClusterifyWindow
  File "C:\msys64/mingw64/share/clusterify\clusterify\window.py", line 36, in <module>
    from sklearn.cluster import MiniBatchKMeans
  File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
  File "sklearn/__init__.py", line 82, in <module>
  File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
  File "sklearn/base.py", line 20, in <module>
  File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
  File "sklearn/utils/__init__.py", line 24, in <module>
  File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
  File "sklearn/utils/_joblib.py", line 7, in <module>
  File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
  File "joblib/__init__.py", line 113, in <module>
  File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
  File "joblib/memory.py", line 16, in <module>
  File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
  File "pydoc.py", line 458, in <module>
  File "pydoc.py", line 488, in Doc
  File "sysconfig.py", line 554, in get_path
  File "sysconfig.py", line 544, in get_paths
  File "sysconfig.py", line 179, in _expand_vars
  File "sysconfig.py", line 594, in get_config_vars
  File "sysconfig.py", line 460, in _init_posix
ModuleNotFoundError: No module named '_sysconfigdata__win32_'
```

--- 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-distutils.py`
Content:
```
1 #-----------------------------------------------------------------------------
2 # Copyright (c) 2005-2021, 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 `distutils`-specific post-import hook.
13 
14 This hook freezes the external `Makefile` and `pyconfig.h` files bundled with the active Python interpreter, which the
15 `distutils.sysconfig` module parses at runtime for platform-specific metadata.
16 """
17 
18 # From Python 3.6 and later ``distutils.sysconfig`` takes on the same behaviour as regular ``sysconfig`` of moving the
19 # config vars to a module (see hook-sysconfig.py). It doesn't use a nice `get module name` function like ``sysconfig``
20 # does to help us locate it but the module is the same file that ``sysconfig`` uses so we can use the
21 # ``_get_sysconfigdata_name()`` from regular ``sysconfig``.
22 import sysconfig
23 
24 from PyInstaller import compat
25 
26 if not compat.is_win and hasattr(sysconfig, '_get_sysconfigdata_name'):
27     hiddenimports = [sysconfig._get_sysconfigdata_name()]
28
```

Path: `PyInstaller/hooks/hook-sysconfig.py`
Content:
```
1 #-----------------------------------------------------------------------------
2 # Copyright (c) 2005-2021, 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 import sysconfig
13 
14 from PyInstaller.compat import is_win
15 
16 if not is_win and hasattr(sysconfig, '_get_sysconfigdata_name'):
17     # Python 3.6 uses additional modules like `_sysconfigdata_m_linux_x86_64-linux-gnu`, see
18     # https://github.com/python/cpython/blob/3.6/Lib/sysconfig.py#L417
19     # Note: Some versions of Anaconda backport this feature to before 3.6. See issue #3105.
20     hiddenimports = [sysconfig._get_sysconfigdata_name()]
21
```
--- 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()

```

diff --git a/PyInstaller/hooks/hook-distutils.py b/PyInstaller/hooks/hook-distutils.py
--- a/PyInstaller/hooks/hook-distutils.py
+++ b/PyInstaller/hooks/hook-distutils.py
@@ -19,9 +19,10 @@
 # config vars to a module (see hook-sysconfig.py). It doesn't use a nice `get module name` function like ``sysconfig``
 # does to help us locate it but the module is the same file that ``sysconfig`` uses so we can use the
 # ``_get_sysconfigdata_name()`` from regular ``sysconfig``.
-import sysconfig
-
-from PyInstaller import compat
-
-if not compat.is_win and hasattr(sysconfig, '_get_sysconfigdata_name'):
+try:
+    import sysconfig
     hiddenimports = [sysconfig._get_sysconfigdata_name()]
+except AttributeError:
+    # Either sysconfig has no attribute _get_sysconfigdata_name (i.e., the function does not exist), or this is Windows
+    # and the _get_sysconfigdata_name() call failed due to missing sys.abiflags attribute.
+    pass
diff --git a/PyInstaller/hooks/hook-sysconfig.py b/PyInstaller/hooks/hook-sysconfig.py
--- a/PyInstaller/hooks/hook-sysconfig.py
+++ b/PyInstaller/hooks/hook-sysconfig.py
@@ -9,12 +9,15 @@
 # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
 #-----------------------------------------------------------------------------
 
-import sysconfig
-
-from PyInstaller.compat import is_win
-
-if not is_win and hasattr(sysconfig, '_get_sysconfigdata_name'):
-    # Python 3.6 uses additional modules like `_sysconfigdata_m_linux_x86_64-linux-gnu`, see
-    # https://github.com/python/cpython/blob/3.6/Lib/sysconfig.py#L417
-    # Note: Some versions of Anaconda backport this feature to before 3.6. See issue #3105.
+# Python 3.6 uses additional modules like `_sysconfigdata_m_linux_x86_64-linux-gnu`, see
+# https://github.com/python/cpython/blob/3.6/Lib/sysconfig.py#L417
+# Note: Some versions of Anaconda backport this feature to before 3.6. See issue #3105.
+# Note: on Windows, python.org and Anaconda python provide _get_sysconfigdata_name, but calling it fails due to sys
+# module lacking abiflags attribute. It does work on MSYS2/MINGW python, where we need to collect corresponding file.
+try:
+    import sysconfig
     hiddenimports = [sysconfig._get_sysconfigdata_name()]
+except AttributeError:
+    # Either sysconfig has no attribute _get_sysconfigdata_name (i.e., the function does not exist), or this is Windows
+    # and the _get_sysconfigdata_name() call failed due to missing sys.abiflags attribute.
+    pass

{"golden_diff": "diff --git a/PyInstaller/hooks/hook-distutils.py b/PyInstaller/hooks/hook-distutils.py\n--- a/PyInstaller/hooks/hook-distutils.py\n+++ b/PyInstaller/hooks/hook-distutils.py\n@@ -19,9 +19,10 @@\n # config vars to a module (see hook-sysconfig.py). It doesn't use a nice `get module name` function like ``sysconfig``\n # does to help us locate it but the module is the same file that ``sysconfig`` uses so we can use the\n # ``_get_sysconfigdata_name()`` from regular ``sysconfig``.\n-import sysconfig\n-\n-from PyInstaller import compat\n-\n-if not compat.is_win and hasattr(sysconfig, '_get_sysconfigdata_name'):\n+try:\n+    import sysconfig\n     hiddenimports = [sysconfig._get_sysconfigdata_name()]\n+except AttributeError:\n+    # Either sysconfig has no attribute _get_sysconfigdata_name (i.e., the function does not exist), or this is Windows\n+    # and the _get_sysconfigdata_name() call failed due to missing sys.abiflags attribute.\n+    pass\ndiff --git a/PyInstaller/hooks/hook-sysconfig.py b/PyInstaller/hooks/hook-sysconfig.py\n--- a/PyInstaller/hooks/hook-sysconfig.py\n+++ b/PyInstaller/hooks/hook-sysconfig.py\n@@ -9,12 +9,15 @@\n # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)\n #-----------------------------------------------------------------------------\n \n-import sysconfig\n-\n-from PyInstaller.compat import is_win\n-\n-if not is_win and hasattr(sysconfig, '_get_sysconfigdata_name'):\n-    # Python 3.6 uses additional modules like `_sysconfigdata_m_linux_x86_64-linux-gnu`, see\n-    # https://github.com/python/cpython/blob/3.6/Lib/sysconfig.py#L417\n-    # Note: Some versions of Anaconda backport this feature to before 3.6. See issue #3105.\n+# Python 3.6 uses additional modules like `_sysconfigdata_m_linux_x86_64-linux-gnu`, see\n+# https://github.com/python/cpython/blob/3.6/Lib/sysconfig.py#L417\n+# Note: Some versions of Anaconda backport this feature to before 3.6. See issue #3105.\n+# Note: on Windows, python.org and Anaconda python provide _get_sysconfigdata_name, but calling it fails due to sys\n+# module lacking abiflags attribute. It does work on MSYS2/MINGW python, where we need to collect corresponding file.\n+try:\n+    import sysconfig\n     hiddenimports = [sysconfig._get_sysconfigdata_name()]\n+except AttributeError:\n+    # Either sysconfig has no attribute _get_sysconfigdata_name (i.e., the function does not exist), or this is Windows\n+    # and the _get_sysconfigdata_name() call failed due to missing sys.abiflags attribute.\n+    pass\n", "issue": "Some hooks should get fixed\n<!--\r\nWelcome to the PyInstaller issue tracker! Before creating an issue, please heed the following:\r\n\r\n1. This tracker should only be used to report bugs and request features / enhancements to PyInstaller\r\n    - For questions and general support, use the mailing list, see\r\n\t  <http://www.pyinstaller.org/support.html#mailing-list>\r\n2. Use the search function before creating a new issue. Duplicates will be closed and directed to\r\n   the original discussion.\r\n3. When making a bug report, make sure you provide all required information. The easier it is for\r\n   maintainers to reproduce, the faster it'll be fixed.\r\n-->\r\n\r\n<!-- +++ ONLY TEXT +++ DO NOT POST IMAGES +++ -->\r\n\r\n## Description of the issue\r\nIt returns `ModuleNotFoundError: No module named '_sysconfigdata__win32_'` at `from sklearn.cluster import MiniBatchKMeans` for some reason\r\n\r\n\r\n### Context information (for bug reports)\r\n\r\n* Output of `pyinstaller --version`: ```4.5.1```\r\n* Version of Python: ```Python 3.9.6```\r\n* Platform: ```MSYS2 MINGW64```\r\n* How you installed Python: ```from MSYS2, the MINGW64 one```\r\n* Did you also try this on another platform? Does it work there? ```Nope```\r\n\r\n* follow *all* the instructions in our \"If Things Go Wrong\" Guide\r\n  (https://github.com/pyinstaller/pyinstaller/wiki/If-Things-Go-Wrong) and\r\n\r\n### Make sure [everything is packaged correctly](https://github.com/pyinstaller/pyinstaller/wiki/How-to-Report-Bugs#make-sure-everything-is-packaged-correctly)\r\n\r\n  * [x] start with clean installation\r\n  * [ ] use the latest development version\r\n  * [x] Run your frozen program **from a command window (shell)** \u2014 instead of double-clicking on it ```But it didn't catch the program, like it runs it in separate process. I use windowed mode, anyways```\r\n  * [ ] Package your program in **--onedir mode**\r\n  * [x] Package **without UPX**, say: use the option `--noupx` or set `upx=False` in your .spec-file\r\n  * [x] Repackage you application in **verbose/debug mode**. For this, pass the option `--debug` to `pyi-makespec` or `pyinstaller` or use `EXE(..., debug=1, ...)` in your .spec file.\r\n\r\n\r\n### A minimal example program which shows the error\r\n#### window.py\r\n```\r\nimport gi\r\ngi.require_version('Gtk', '3.0')\r\nfrom gi.repository import Gtk, Gio\r\nimport os\r\nimport gc\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom sklearn.cluster import MiniBatchKMeans\r\nfrom sklearn.preprocessing import StandardScaler\r\nfrom sklearn.decomposition import PCA\r\n\r\n@Gtk.Template(resource_path='/org/example/App/window.ui')\r\nclass ClusterifyWindow(Gtk.ApplicationWindow):\r\n    __gtype_name__ = 'ClusterifyWindow'\r\n    full_initialized = False\r\n\r\n    ...\r\n\r\n    def __init__(self, log_error, **kwargs):\r\n        super().__init__(**kwargs)\r\n        self.log_error = log_error\r\n\r\n    @Gtk.Template.Callback()\r\n    def on_ClusterifyWindow_focus_in_event(self, cb_widget, data):\r\n        if not self.full_initialized:\r\n            import matplotlib\r\n            matplotlib.use(\"GTK3Cairo\")\r\n            import matplotlib.pyplot as plt\r\n            import seaborn as sns\r\n            sns.set()\r\n            from matplotlib.backends.backend_gtk3cairo import FigureCanvasGTK3Cairo as FigureCanvas\r\n\r\n            self.fi_clusters = plt.figure()\r\n            self.cv_clusters = FigureCanvas(self.fi_clusters)\r\n            self.cv_clusters.show_all()\r\n\r\n            ...\r\n\r\n        self.full_initialized = True\r\n```\r\n\r\n#### clusterify.spec\r\n```\r\n# -*- mode: python ; coding: utf-8 -*-\r\n\r\ntypelib_path = \"C:/msys64/mingw64/lib/girepository-1.0\"\r\nblock_cipher = None\r\n\r\n\r\na = Analysis(['C:/msys64/mingw64/bin/clusterify'],\r\n             pathex=['C:/msys64/home/rivan/Clusterify'],\r\n             binaries=[(os.path.join(typelib_path, tl), 'gi_typelibs') for tl in os.listdir(typelib_path)],\r\n             datas=[],\r\n             hiddenimports=['numpy',\r\n                            'pandas',\r\n                            'sklearn.cluster', 'sklearn.preprocessing', 'sklearn.decomposition',\r\n                            'matplotlib', 'matplotlib.backends.backend_gtk3cairo',\r\n                            'seaborn'],\r\n             hookspath=[],\r\n             hooksconfig={},\r\n             runtime_hooks=[],\r\n             excludes=[],\r\n             win_no_prefer_redirects=False,\r\n             win_private_assemblies=False,\r\n             cipher=block_cipher,\r\n             noarchive=False)\r\npyz = PYZ(a.pure, a.zipped_data,\r\n             cipher=block_cipher)\r\n\r\nexe = EXE(pyz,\r\n          a.scripts,\r\n          a.binaries,\r\n          a.zipfiles,\r\n          a.datas,  \r\n          [],\r\n          name='clusterify',\r\n          debug=True,\r\n          bootloader_ignore_signals=False,\r\n          strip=False,\r\n          upx=False,\r\n          upx_exclude=[],\r\n          runtime_tmpdir=None,\r\n          console=False,\r\n          disable_windowed_traceback=False,\r\n          target_arch=None,\r\n          codesign_identity=None,\r\n          entitlements_file=None )\r\n```\r\n\r\n### Stacktrace / full error message\r\n```\r\nTraceback (most recent call last):\r\n  File \"clusterify\", line 51, in <module>\r\n  File \"C:\\msys64/mingw64/share/clusterify\\clusterify\\main.py\", line 33, in <module>\r\n    from .window import ClusterifyWindow\r\n  File \"C:\\msys64/mingw64/share/clusterify\\clusterify\\window.py\", line 36, in <module>\r\n    from sklearn.cluster import MiniBatchKMeans\r\n  File \"PyInstaller/loader/pyimod03_importers.py\", line 546, in exec_module\r\n  File \"sklearn/__init__.py\", line 82, in <module>\r\n  File \"PyInstaller/loader/pyimod03_importers.py\", line 546, in exec_module\r\n  File \"sklearn/base.py\", line 20, in <module>\r\n  File \"PyInstaller/loader/pyimod03_importers.py\", line 546, in exec_module\r\n  File \"sklearn/utils/__init__.py\", line 24, in <module>\r\n  File \"PyInstaller/loader/pyimod03_importers.py\", line 546, in exec_module\r\n  File \"sklearn/utils/_joblib.py\", line 7, in <module>\r\n  File \"PyInstaller/loader/pyimod03_importers.py\", line 546, in exec_module\r\n  File \"joblib/__init__.py\", line 113, in <module>\r\n  File \"PyInstaller/loader/pyimod03_importers.py\", line 546, in exec_module\r\n  File \"joblib/memory.py\", line 16, in <module>\r\n  File \"PyInstaller/loader/pyimod03_importers.py\", line 546, in exec_module\r\n  File \"pydoc.py\", line 458, in <module>\r\n  File \"pydoc.py\", line 488, in Doc\r\n  File \"sysconfig.py\", line 554, in get_path\r\n  File \"sysconfig.py\", line 544, in get_paths\r\n  File \"sysconfig.py\", line 179, in _expand_vars\r\n  File \"sysconfig.py\", line 594, in get_config_vars\r\n  File \"sysconfig.py\", line 460, in _init_posix\r\nModuleNotFoundError: No module named '_sysconfigdata__win32_'\r\n```\n", "before_files": [{"content": "#-----------------------------------------------------------------------------\n# Copyright (c) 2005-2021, 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`distutils`-specific post-import hook.\n\nThis hook freezes the external `Makefile` and `pyconfig.h` files bundled with the active Python interpreter, which the\n`distutils.sysconfig` module parses at runtime for platform-specific metadata.\n\"\"\"\n\n# From Python 3.6 and later ``distutils.sysconfig`` takes on the same behaviour as regular ``sysconfig`` of moving the\n# config vars to a module (see hook-sysconfig.py). It doesn't use a nice `get module name` function like ``sysconfig``\n# does to help us locate it but the module is the same file that ``sysconfig`` uses so we can use the\n# ``_get_sysconfigdata_name()`` from regular ``sysconfig``.\nimport sysconfig\n\nfrom PyInstaller import compat\n\nif not compat.is_win and hasattr(sysconfig, '_get_sysconfigdata_name'):\n    hiddenimports = [sysconfig._get_sysconfigdata_name()]\n", "path": "PyInstaller/hooks/hook-distutils.py"}, {"content": "#-----------------------------------------------------------------------------\n# Copyright (c) 2005-2021, 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\nimport sysconfig\n\nfrom PyInstaller.compat import is_win\n\nif not is_win and hasattr(sysconfig, '_get_sysconfigdata_name'):\n    # Python 3.6 uses additional modules like `_sysconfigdata_m_linux_x86_64-linux-gnu`, see\n    # https://github.com/python/cpython/blob/3.6/Lib/sysconfig.py#L417\n    # Note: Some versions of Anaconda backport this feature to before 3.6. See issue #3105.\n    hiddenimports = [sysconfig._get_sysconfigdata_name()]\n", "path": "PyInstaller/hooks/hook-sysconfig.py"}], "after_files": [{"content": "#-----------------------------------------------------------------------------\n# Copyright (c) 2005-2021, 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`distutils`-specific post-import hook.\n\nThis hook freezes the external `Makefile` and `pyconfig.h` files bundled with the active Python interpreter, which the\n`distutils.sysconfig` module parses at runtime for platform-specific metadata.\n\"\"\"\n\n# From Python 3.6 and later ``distutils.sysconfig`` takes on the same behaviour as regular ``sysconfig`` of moving the\n# config vars to a module (see hook-sysconfig.py). It doesn't use a nice `get module name` function like ``sysconfig``\n# does to help us locate it but the module is the same file that ``sysconfig`` uses so we can use the\n# ``_get_sysconfigdata_name()`` from regular ``sysconfig``.\ntry:\n    import sysconfig\n    hiddenimports = [sysconfig._get_sysconfigdata_name()]\nexcept AttributeError:\n    # Either sysconfig has no attribute _get_sysconfigdata_name (i.e., the function does not exist), or this is Windows\n    # and the _get_sysconfigdata_name() call failed due to missing sys.abiflags attribute.\n    pass\n", "path": "PyInstaller/hooks/hook-distutils.py"}, {"content": "#-----------------------------------------------------------------------------\n# Copyright (c) 2005-2021, 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# Python 3.6 uses additional modules like `_sysconfigdata_m_linux_x86_64-linux-gnu`, see\n# https://github.com/python/cpython/blob/3.6/Lib/sysconfig.py#L417\n# Note: Some versions of Anaconda backport this feature to before 3.6. See issue #3105.\n# Note: on Windows, python.org and Anaconda python provide _get_sysconfigdata_name, but calling it fails due to sys\n# module lacking abiflags attribute. It does work on MSYS2/MINGW python, where we need to collect corresponding file.\ntry:\n    import sysconfig\n    hiddenimports = [sysconfig._get_sysconfigdata_name()]\nexcept AttributeError:\n    # Either sysconfig has no attribute _get_sysconfigdata_name (i.e., the function does not exist), or this is Windows\n    # and the _get_sysconfigdata_name() call failed due to missing sys.abiflags attribute.\n    pass\n", "path": "PyInstaller/hooks/hook-sysconfig.py"}]}