简体   繁体   中英

Pyinstaller can't create the .exe file

I wanted to convert my python code into an executable and came across Pyinstaller package. However while running pyinstaller --onefile my_python_code.py from my cmd prompt it throws an ImportErrorWhenRunningHook for with numpy. I don't know where/ how to find the required module in my machine as per the error instructions. Can anybody please help me understand the error message and overcome the challenge?

edit:

... 281436 INFO: Loading module hook 'hook-matplotlib.backends.py' from 'c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\hooks'... c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy_ init _.py:138: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service from. import distributor_init Traceback (most recent call last): File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core_ init .py", line 22, in from. import multiarray File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core\multiarray.py", line 12, in from. import overrides File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core\overrides.py", line 7, in from numpy.core._multiarray_umath import ( ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\matplotlib_ init _.py", line 107, in from. import cbook, rcsetup File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\matplotlib\cbook_ init _.py", line 28, in import numpy as np File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy_ init _.py", line 140, in from. import core File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core_ init _.py", line 48, in raise ImportError(msg) ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed.

We have compiled some common reasons and troubleshooting tips at:

 https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.7 from "c:\programdata\anaconda3\envs\geo_env\python.exe" * The NumPy version is: "1.19.1"

and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help.

Original error was: DLL load failed: The specified module could not be found.

281586 INFO: Loading module hook 'hook-matplotlib.py' from 'c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\hooks'... c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy_ init _.py:138: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service from. import distributor_init Traceback (most recent call last): File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core_ init .py", line 22, in from. import multiarray File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core\multiarray.py", line 12, in from. import overrides File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core\overrides.py", line 7, in from numpy.core._multiarray_umath import ( ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\matplotlib_ init _.py", line 107, in from. import cbook, rcsetup File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\matplotlib\cbook_ init _.py", line 28, in import numpy as np File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy_ init _.py", line 140, in from. import core File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core_ init _.py", line 48, in raise ImportError(msg) ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed.

We have compiled some common reasons and troubleshooting tips at:

 https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.7 from "c:\programdata\anaconda3\envs\geo_env\python.exe" * The NumPy version is: "1.19.1"

and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help.

Original error was: DLL load failed: The specified module could not be found.

281757 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\hooks'... 281769 INFO: Loading module hook 'hook-numpy.core.py' from 'c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\hooks'... c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy_ init _.py:138: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service from. import distributor_init c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy_ init .py:138: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service from. import distributor_init Traceback (most recent call last): File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core_ init .py", line 22, in from. import multiarray File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core\multiarray.py", line 12, in from. import overrides File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core\overrides.py", line 7, in from numpy.core._multiarray_umath import ( ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 2, in File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy_ init _.py", line 140, in from. import core File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core_ init _.py", line 48, in raise ImportError(msg) ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed.

We have compiled some common reasons and troubleshooting tips at:

 https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.7 from "c:\programdata\anaconda3\envs\geo_env\python.exe" * The NumPy version is: "1.19.1"

and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help.

Original error was: DLL load failed: The specified module could not be found.

Traceback (most recent call last): File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core_ init _.py", line 22, in from. import multiarray File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core\multiarray.py", line 12, in from. import overrides File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core\overrides.py", line 7, in from numpy.core._multiarray_umath import ( ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\programdata\anaconda3\envs\geo_env\lib\pkgutil.py", line 493, in find_loader spec = importlib.util.find_spec(fullname) File "c:\programdata\anaconda3\envs\geo_env\lib\importlib\util.py", line 94, in find_spec parent = import (parent_name, fromlist=[' path ']) File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy_ init _.py", line 140, in from. import core File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\numpy\core_ init _.py", line 48, in raise ImportError(msg) ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed.

We have compiled some common reasons and troubleshooting tips at:

 https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.7 from "c:\programdata\anaconda3\envs\geo_env\python.exe" * The NumPy version is: "1.19.1"

and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help.

Original error was: DLL load failed: The specified module could not be found.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\utils\hooks_ init _.py", line 289, in get_module_file_attribute loader = pkgutil.find_loader(package) File "c:\programdata\anaconda3\envs\geo_env\lib\pkgutil.py", line 499, in find_loader raise ImportError(msg.format(fullname, type(ex), ex)) from ex ImportError: Error while finding loader for 'numpy.core' (<class 'ImportError'>:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed.

We have compiled some common reasons and troubleshooting tips at:

 https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.7 from "c:\programdata\anaconda3\envs\geo_env\python.exe" * The NumPy version is: "1.19.1"

and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help.

Original error was: DLL load failed: The specified module could not be found. )

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\depend\imphook.py", line 409, in _load_hook_module self.hook_module_name, self.hook_filename) File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\compat.py", line 593, in importlib_load_source return mod_loader.load_module() File "", line 407, in _check_name_wrapper
File "", line 907, in load_module File "", line 732, in load_module File "", line 265, in _load_module_shim File "", line 696, in _load File "", line 677, in load_unlocked File "", line 728, in exec_module File "", line 219, in call_with_frames_removed File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\hooks\hook-numpy.core.py", line 29, in pkg_base, pkg_dir = get_package_paths('numpy.core') File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\utils\hooks_ init .py", line 506, in get_package_paths file_attr = get_module_file_attribute(package) File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\utils\hooks_ init .py", line 308, in get_module_file_attribute raise ImportError('Unable to load module attribute') from e ImportError: Unable to load module attribute

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\programdata\anaconda3\envs\geo_env\lib\runpy.py", line 193, in run_module_as_main " main ", mod_spec) File "c:\programdata\anaconda3\envs\geo_env\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "C:\ProgramData\Anaconda3\envs\geo_env\Scripts\pyinstaller.exe_ main .py", line 7, in File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller_ main .py", line 114, in run run_build(pyi_config, spec_file, **vars(args)) File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller_ main _.py", line 65, in run_build PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs) File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\building\build_main.py", line 720, in main build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build')) File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\building\build_main.py", line 667, in build exec(code, spec_namespace) File "C:\Users\pandas10\Desktop\sa_fmcg_forecast\py_exe\fmcg_forecast.spec", line 17, in noarchive=False) File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\building\build_main.py", line 242, in init self. postinit () File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\building\datastruct.py", line 160, in postinit self.assemble() File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\building\build_main.py", line 419, in assemble self.graph.process_post_graph_hooks() File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\depend\analysis.py", line 367, in process_post_graph_hooks module_hook.post_graph() File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\depend\imphook.py", line 447, in post_graph self._load_hook_module() File "c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\depend\imphook.py", line 413, in _load_hook_module self.hook_module_name, self.hook_filename) PyInstaller.exceptions.ImportErrorWhenRunningHook: Failed to import module __PyInstaller_hooks_0_numpy_core required by hook for module c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\hooks\h ook-numpy.core.py. Please check whether module __PyInstaller_hooks_0_numpy_core actually exists and whether the hook is compatible with your version of c:\programdata\anaconda3\envs\geo_env\lib\site-packages\PyInstaller\hooks\hook-numpy.core.py: You might want to read more about hooks in the manual and provide a pull-request to improve PyInstaller.

Note: I am using Anaconda and working in a separate environment than python base or default .

After reading the whole log file, it seems like the installer did not download all the packages. I strongly recommend uninstalling the package and reinstalling it.

For uninstalling - Open a command or terminal window (depending on the operating system) cd into the project directory. pip uninstall pyinstaller

And to reinstall - If u r using PyCharm, just go to terminal on the bottom and type - pip install pyinstaller

If u r using other things (I don't know about what you may be using) - On Windows - press Windows Key + R and type cmd

On Mac - go to Finder/ Applications/ Terminal (I may be wrong)

Now type the command - pip install pyinstaller

See the installation process and the packages being installed, if there is already a package installed, it will skip its installation, and if one isn't installed, pip will install it.

Based on the log, obviously you are using the Anaconda python distribution. the Import error is happening cause the mkl-service's DLL can't be found, which should be located in:

C:\Users\\anaconda3\Library\bin

or

C:\Users<username>\anaconda3\envs\<env_name>\Library\bin

The most likely reason why the necessary DLLs can't be found (assuming mkl-service has been installed correctly) is the absence of the above directory in the PATH environment variable.

The mentioned path is usually prepended to the PATH by the Anaconda Prompt before build, so one solution is to run the command in the Anaconda Prompt.

Other solutions include:

  1. Either append the mentioned directory to the PATH globally (by editing the PATH variable in the Windows Settings), or
  2. Find a way to temporarily append it to the PATH (for the duration of your code's execution), specific to your development environment.
please help django project to pyinstaller ImportErrorWhenRunningHook error

(base) C:\Users\user\Desktop\work\youngjae\Samsung_Hospital2\Local\ECG>pyinstaller --onefile --icon=PAPS_Logo.ico manage.py
2167 INFO: PyInstaller: 5.6.2
2167 INFO: Python: 3.8.8 (conda)
2169 INFO: Platform: Windows-10-10.0.22621-SP0
2170 INFO: wrote C:\Users\user\Desktop\work\youngjae\Samsung_Hospital2\Local\ECG\manage.spec
2173 INFO: UPX is not available.
2175 INFO: Extending PYTHONPATH with paths
['C:\\Users\\user\\Desktop\\work\\youngjae\\Samsung_Hospital2\\Local\\ECG']
pygame 2.1.2 (SDL 2.0.18, Python 3.8.8)
Hello from the pygame community. https://www.pygame.org/contribute.html
4439 INFO: checking Analysis
4439 INFO: Building Analysis because Analysis-00.toc is non existent
4440 INFO: Initializing module dependency graph...
4449 INFO: Caching module graph hooks...
4458 WARNING: Several hooks defined for module 'numpy'. Please take care they do not conflict.
4466 INFO: Analyzing base_library.zip ...
14853 INFO: Loading module hook 'hook-heapq.py' from 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
15297 INFO: Loading module hook 'hook-encodings.py' from 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
20044 INFO: Loading module hook 'hook-pickle.py' from 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
21505 INFO: Caching module dependency graph...
21667 INFO: running Analysis Analysis-00.toc
21684 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by C:\ProgramData\Anaconda3\python.exe
21873 INFO: Analyzing C:\Users\user\Desktop\work\youngjae\Samsung_Hospital2\Local\ECG\manage.py
22108 INFO: Loading module hook 'hook-django.py' from 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\PyInstaller\\hooks'...
3243 WARNING: Failed to collect submodules for 'django.contrib.gis.admin' because importing 'django.contrib.gis.admin' raised: django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
32438 INFO: Determining a mapping of distributions to packages...
340593 INFO: Packages required by django:
['pytz', 'sqlparse']
340594 INFO: Django root directory C:\Users\user\Desktop\work\youngjae\Samsung_Hospital2\Local\ECG\djangoproject
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\utils\hooks\subproc\django_import_finder.py", line 24, in <module>
    django.setup()
  File "C:\ProgramData\Anaconda3\lib\site-packages\django\__init__.py", line 19, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "C:\ProgramData\Anaconda3\lib\site-packages\django\conf\__init__.py", line 79, in __getattr__
    self._setup(name)
  File "C:\ProgramData\Anaconda3\lib\site-packages\django\conf\__init__.py", line 66, in _setup
    self._wrapped = Settings(settings_module)
  File "C:\ProgramData\Anaconda3\lib\site-packages\django\conf\__init__.py", line 157, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\user\Desktop\work\youngjae\Samsung_Hospital2\Local\ECG\djangoproject\settings.py", line 250, in <module>
    STATIC_DIR = os.path.join(BASE_DIR, 'static')
  File "C:\ProgramData\Anaconda3\lib\ntpath.py", line 78, in join
    path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not WindowsPath
341077 INFO: Collecting Django migration scripts.
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 394, in get_module_file_attribute
    filename = _get_module_file_attribute(package)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\isolated\_parent.py", line 368, in wrapped
    return call(function, *args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\isolated\_parent.py", line 337, in call
    return isolated.call(function, *args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\isolated\_parent.py", line 275, in call
    raise RuntimeError(f"Child process call to {function.__name__}() failed with:\n" + output)
RuntimeError: Child process call to _get_module_file_attribute() failed with:
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command
    output = function(*args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 389, in _get_module_file_attribute
    p = importlib.import_module(package)
  File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'corsheaders'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\depend\imphook.py", line 387, in _load_hook_module
    self._hook_module = importlib_load_source(self.hook_module_name, self.hook_filename)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\compat.py", line 609, in importlib_load_source
    return mod_loader.load_module()
  File "<frozen importlib._bootstrap_external>", line 462, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 962, in load_module
  File "<frozen importlib._bootstrap_external>", line 787, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\hooks\hook-django.py", line 71, in <module>
    mod_dir = os.path.dirname(hooks.get_module_file_attribute(mod_name))
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 396, in get_module_file_attribute
    raise ImportError(f"Failed to obtain the __file__ attribute of package/module {package}!") from e
ImportError: Failed to obtain the __file__ attribute of package/module corsheaders!

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\Scripts\pyinstaller-script.py", line 10, in <module>
    sys.exit(run())
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\__main__.py", line 179, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\__main__.py", line 60, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 963, in main
    build(specfile, distpath, workpath, clean_build)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 885, in build
    exec(code, spec_namespace)
  File "C:\Users\user\Desktop\work\youngjae\Samsung_Hospital2\Local\ECG\manage.spec", line 7, in <module>
    a = Analysis(
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 410, in __init__
    self.__postinit__()
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\building\datastruct.py", line 173, in __postinit__
    self.assemble()
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 573, in assemble
    priority_scripts.append(self.graph.add_script(script))
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\depend\analysis.py", line 268, in add_script
    self._top_script_node = super().add_script(pathname)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1433, in add_script
    self._process_imports(n)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
    target_modules = self._safe_import_hook(*import_info, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\depend\analysis.py", line 381, in _safe_import_hook
    return super()._safe_import_hook(target_module_partname, source_module, target_attr_names, level, edge_attr)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
    target_modules = self.import_hook(
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
    target_package, target_module_partname = self._find_head_package(
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
    target_package = self._safe_import_module(
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\depend\analysis.py", line 428, in _safe_import_module
    return super()._safe_import_module(module_basename, module_name, parent_package)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
    self._process_imports(n)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
    target_modules = self._safe_import_hook(*import_info, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\depend\analysis.py", line 368, in _safe_import_hook
    excluded_imports = self._find_all_excluded_imports(source_module.identifier)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\depend\analysis.py", line 356, in _find_all_excluded_imports
    excluded_imports.update(module_hook.excludedimports)
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\depend\imphook.py", line 320, in __getattr__
    self._load_hook_module()
  File "C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\depend\imphook.py", line 390, in _load_hook_module
    raise ImportErrorWhenRunningHook(self.hook_module_name, self.hook_filename)
PyInstaller.exceptions.ImportErrorWhenRunningHook: Failed to import module __PyInstaller_hooks_0_django required by hook for module C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\hooks\hook-django.py. Please check whether module __PyInstaller_hooks_0_django actually exists and whether the hook is compatible with your version of C:\ProgramData\Anaconda3\lib\site-packages\PyInstaller\hooks\hook-django.py: You might want to read more about hooks in the manual and provide a pull-request to improve PyInstaller.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM