CONNEXION
  • RetourJeux
    • Sorties
    • Hit Parade
    • Les + populaires
    • Les + attendus
    • Soluces
    • Tous les Jeux
    • Gaming
  • RetourActu Gaming
    • News
    • Astuces
    • Tests
    • Previews
    • Toute l'actu gaming
  • RetourBons plans
    • Bons plans
    • Bons plans Smartphone
    • Bons plans Hardware
    • Bons plans Image et Son
    • Bons plans Amazon
    • Bons plans Cdiscount
    • Bons plans Decathlon
    • Bons plans Fnac
    • Tous les Bons plans
  • RetourJVTech
    • Actus High-Tech
    • Intelligence Artificielle
    • Smartphones
    • Mobilité urbaine
    • Hardware
    • Image et son
    • Tutoriels
    • Tests produits High-Tech
    • Guides d'achat High-Tech
    • JVTech
  • RetourCulture
    • Actus Culture
    • Culture
  • RetourVidéos
    • A la une
    • Gaming Live
    • Vidéos Tests
    • Vidéos Previews
    • Gameplay
    • Trailers
    • Chroniques
    • Replay Web TV
    • Toutes les vidéos
  • RetourForums
    • Hardware PC
    • PS5
    • Switch 2
    • Xbox Series
    • Switch
    • Pokemon pocket
    • FC 25 Ultimate Team
    • League of Legends
    • Tous les Forums
  • PC
  • PS5
  • Xbox Series
  • Switch 2
  • PS4
  • One
  • Switch
  • iOS
  • Android
  • MMO
  • RPG
  • FPS
En ce moment Genshin Impact Valhalla Breath of the wild Animal Crossing GTA 5 Red dead 2
Liste des sujets

Probleme lors de la création d'un .exe Pyinstaller (python)

les-toilettes
les-toilettes
Niveau 6
10 mai 2022 à 18:37:45

Hello hello,
J'ai fait un petit script en python qui fonctionne tres bien, mais quand je veux créer le .exe:
-je n'ai pas le mm message que d'ahabitude
-mon dossier dist est vide

J'ai bien installé Pyinstaller

Voila le message que j'ai:

ModuleNotFoundError: No module named 'text_unidecode'

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

Traceback (most recent call last):
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\imphook.py", line 361, in _load_hook_module
    self._hook_module = importlib_load_source(self.hook_module_name, self.hook_filename)
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\compat.py", line 620, in importlib_load_source
    return mod_loader.load_module()
  File "<frozen importlib._bootstrap_external>", line 548, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1063, in load_module
  File "<frozen importlib._bootstrap_external>", line 888, in load_module
  File "<frozen importlib._bootstrap>", line 290, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 719, in _load
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks\hook-faker.py", line 17, in <module>     
    collect_data_files('text_unidecode') +  # noqa: W504
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 744, in collect_data_files
    pkg_base, pkg_dir = get_package_paths(package)
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 534, in get_package_paths
    file_attr = get_module_file_attribute(package)
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 392, 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 text_unidecode!

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py", line 178, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py", line 59, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 845, in main
    build(specfile, distpath, workpath, clean_build)
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 767, in build
    exec(code, spec_namespace)
  File "C:\Users\mikal\PycharmProjects\pendu\main.spec", line 7, in <module>
    a = Analysis(
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 319, in __init__
    self.__postinit__()
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\datastruct.py", line 173, in __postinit__
    self.assemble()
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 487, in assemble
    self.graph.process_post_graph_hooks(self)
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 326, in process_post_graph_hooks
    module_hook.post_graph(analysis)
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\imphook.py", line 398, in post_graph
    self._load_hook_module()
  File "C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\imphook.py", line 364, in _load_hook_module
    raise ImportErrorWhenRunningHook(self.hook_module_name, self.hook_filename)
PyInstaller.exceptions.ImportErrorWhenRunningHook: Failed to import module __PyInstaller_hooks_0_faker required by hook for module C:\Users\mikal\AppData\Local\Prog
rams\Python\Python310\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks\hook-faker.py. Please check whether module __PyInstaller_hooks_0_faker actually ex
ists and whether the hook is compatible with your version of C:\Users\mikal\AppData\Local\Programs\Python\Python310\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks\hook-faker.py: You might want to read more about hooks in the manual and provide a pull-request to improve PyInstaller.

Et le dossier dist
https://image.noelshack.com/fichiers/2022/19/2/1652200839-capture-d-ecran-2022-05-10-184014.png

Message édité le 10 mai 2022 à 18:40:49 par les-toilettes
Magrozz
Magrozz
Niveau 7
10 mai 2022 à 18:48:16

ModuleNotFoundError: No module named 'text_unidecode'

les-toilettes
les-toilettes
Niveau 6
10 mai 2022 à 18:48:43

Le 10 mai 2022 à 18:48:16 :
ModuleNotFoundError: No module named 'text_unidecode'

j'ai vu mais je n'ai pas de module "text_unidecode"

Azerban
Azerban
Niveau 16
10 mai 2022 à 19:58:44
pip install text-unidecode
Sujet fermé pour la raison suivante : resolu
Sous forums
  • Aide à l'achat Mac
  • Macintosh
  • Création de Jeux
  • Programmation
  • Création de sites web
  • Linux
  • Internet
  • Steam Deck
  • Hardware
La vidéo du moment