Partage
  • Partager sur Facebook
  • Partager sur Twitter

Compilation vers .exe

    12 août 2018 à 22:05:35

    C:\Users\Guillaume\AppData\Local\Programs\Python\Python36-32\Scripts>pyinstaller Monsetup.py
    329 INFO: PyInstaller: 3.3.1
    329 INFO: Python: 3.6.4
    329 INFO: Platform: Windows-10-10.0.17134-SP0
    333 INFO: wrote C:\Users\Guillaume\AppData\Local\Programs\Python\Python36-32\Scripts\Monsetup.spec
    335 INFO: UPX is not available.
    336 INFO: Extending PYTHONPATH with paths
    ['C:\\Users\\Guillaume\\AppData\\Local\\Programs\\Python\\Python36-32\\Scripts',
     'C:\\Users\\Guillaume\\AppData\\Local\\Programs\\Python\\Python36-32\\Scripts']
    336 INFO: checking Analysis
    336 INFO: Building Analysis because out00-Analysis.toc is non existent
    336 INFO: Initializing module dependency graph...
    339 INFO: Initializing module graph hooks...
    344 INFO: Analyzing base_library.zip ...
    4412 INFO: running Analysis out00-Analysis.toc
    9180 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
      required by c:\users\guillaume\appdata\local\programs\python\python36-32\python.exe
    9253 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python.exe
    9302 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python.exe
    9359 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python.exe
    9412 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python.exe
    9461 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python.exe
    9632 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python36.dll
    9682 WARNING: lib not found: api-ms-win-crt-conio-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python36.dll
    9734 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python36.dll
    9782 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python36.dll
    9833 WARNING: lib not found: api-ms-win-crt-process-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python36.dll
    9891 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python36.dll
    9941 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python36.dll
    9993 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python36.dll
    10045 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python36.dll
    10099 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python36.dll
    10148 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python36.dll
    10200 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\python36.dll
    10263 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\VCRUNTIME140.dll
    10314 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\VCRUNTIME140.dll
    10364 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\VCRUNTIME140.dll
    10417 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\VCRUNTIME140.dll
    10471 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\guillaume\appdata\local\programs\python\python36-32\VCRUNTIME140.dll
    10475 INFO: Caching module hooks...
    10481 INFO: Analyzing C:\Users\Guillaume\AppData\Local\Programs\Python\Python36-32\Scripts\Monsetup.py
    11014 INFO: Processing pre-find module path hook   distutils
    12613 INFO: Processing pre-find module path hook   site
    12617 INFO: site: retargeting to fake-dir 'c:\\users\\guillaume\\appdata\\local\\programs\\python\\python36-32\\lib\\site-packages\\PyInstaller\\fake-modules'
    13776 INFO: Processing pre-safe import module hook   urllib3.packages.six.moves
    15468 INFO: Loading module hooks...
    15468 INFO: Loading module hook "hook-certifi.py"...
    15474 INFO: Loading module hook "hook-distutils.py"...
    15482 INFO: Loading module hook "hook-encodings.py"...
    15562 INFO: Loading module hook "hook-lib2to3.py"...
    15572 INFO: Loading module hook "hook-PIL.Image.py"...
    16186 INFO: Loading module hook "hook-PIL.py"...
    16194 INFO: Excluding import 'PyQt4'
    16196 INFO:   Removing import of PyQt4 from module PIL.ImageQt
    16197 INFO: Import to be excluded not found: 'FixTk'
    16198 INFO: Excluding import 'PySide'
    16200 INFO:   Removing import of PySide from module PIL.ImageQt
    16201 INFO: Excluding import 'tkinter'
    16203 INFO:   Removing import of tkinter from module PIL.ImageTk
    16204 INFO: Excluding import 'PyQt5'
    16206 INFO:   Removing import of PyQt5.QtCore from module PIL.ImageQt
    16207 INFO:   Removing import of PyQt5.QtGui from module PIL.ImageQt
    16208 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
    16212 INFO: Import to be excluded not found: 'FixTk'
    16213 INFO: Excluding import 'tkinter'
    16214 INFO: Loading module hook "hook-pkg_resources.py"...
    16680 INFO: Processing pre-safe import module hook   win32com
    17047 INFO: Loading module hook "hook-pycparser.py"...
    17330 INFO: Loading module hook "hook-pydoc.py"...
    17333 INFO: Loading module hook "hook-PyQt5.py"...
    17337 INFO: Loading module hook "hook-PyQt5.Qt.py"...
    17339 INFO: Loading module hook "hook-PyQt5.QtCore.py"...
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
    ImportError: DLL load failed: Le module spécifié est introuvable.
    Traceback (most recent call last):
      File "C:\Users\Guillaume\AppData\Local\Programs\Python\Python36-32\Scripts\pyinstaller-script.py", line 11, in <module>
        load_entry_point('PyInstaller==3.3.1', 'console_scripts', 'pyinstaller')()
      File "c:\users\guillaume\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\__main__.py", line 94, in run
        run_build(pyi_config, spec_file, **vars(args))
      File "c:\users\guillaume\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\__main__.py", line 46, in run_build
        PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
      File "c:\users\guillaume\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\building\build_main.py", line 791, in main
        build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
      File "c:\users\guillaume\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\building\build_main.py", line 737, in build
        exec(text, spec_namespace)
      File "<string>", line 16, in <module>
      File "c:\users\guillaume\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\building\build_main.py", line 213, in __init__
        self.__postinit__()
      File "c:\users\guillaume\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\building\datastruct.py", line 161, in __postinit__
        self.assemble()
      File "c:\users\guillaume\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\building\build_main.py", line 472, in assemble
        module_hook.post_graph()
      File "c:\users\guillaume\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\building\imphook.py", line 410, in post_graph
        self._load_hook_module()
      File "c:\users\guillaume\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\building\imphook.py", line 377, in _load_hook_module
        self.hook_module_name, self.hook_filename)
      File "c:\users\guillaume\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\compat.py", line 744, in importlib_load_source
        return mod_loader.load_module()
      File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
      File "<frozen importlib._bootstrap_external>", line 823, in load_module
      File "<frozen importlib._bootstrap_external>", line 682, in load_module
      File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
      File "<frozen importlib._bootstrap>", line 684, in _load
      File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 678, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "c:\users\guillaume\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\hooks\hook-PyQt5.QtCore.py", line 15, in <module>
        binaries = qt_plugins_binaries('codecs', namespace='PyQt5')
      File "c:\users\guillaume\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\utils\hooks\qt.py", line 65, in qt_plugins_binaries
        pdir = qt_plugins_dir(namespace=namespace)
      File "c:\users\guillaume\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\utils\hooks\qt.py", line 39, in qt_plugins_dir
        raise Exception('Cannot find {0} plugin directories'.format(namespace))
    Exception: Cannot find PyQt5 plugin directories
    
    
    Voila lorsque j'essaie de convertir mon programme.py je tombe sur ça et ca ne fonctionne pas je comprends pas pourquoi ^^
    • Partager sur Facebook
    • Partager sur Twitter
      12 août 2018 à 22:15:26

      Salut :)

      As-tu testé un code simple quitte à utiliser un outil d'interface graphique pour avoir un programme fenêtré ?

      Normalement, sur Windows, tu peux copier le script python et le renommer avec l'extension pyw. À tester pour voir. 

      • Partager sur Facebook
      • Partager sur Twitter
        12 août 2018 à 22:18:59

        Ah le problème vient du fais que mon code n'ai pas d'interface graphique, ou je suis idiot et j'ai pas compris ce que tu voulais dire ?

        -
        Edité par RedTenZ 12 août 2018 à 22:20:57

        • Partager sur Facebook
        • Partager sur Twitter
          12 août 2018 à 22:28:37

          Ton code est dans un éditeur de texte. On lance l'exécution par le terminal qui est juste un outil.

          Sur n'importe quel système d'exploitation, tu dois avoir une ligne shebang, généralement :

          #!/usr/bin/python3

          le chemin correspond à l'emplacement de l'exécutable python. On le lit en tapant :

          which python3

          dans le terminal

          Ce que je viens d'écrire est valable pour Mac et Linux.

          Ensuite pour lancer au clic de souris, sur Linux, il faut créer un fichier .desktop (pensez à le rendre exécutable, tout comme le script python). Pour rendre exécutable un fichier :

          chmod +x <fichier>
          # exemple avec le fichier : file.exe
          chmod +x file.exe

          Pour Mac, il faut changer l'extension de py par command : fichier.command

          Malheureusement, je n'ai jamais programmé sur Windows, je l'ai, si j'y pense, demain, j'essaie ce que je te propose dans mon précédent message.



          • Partager sur Facebook
          • Partager sur Twitter

          Compilation vers .exe

          × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
          × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
          • Editeur
          • Markdown