Não é possível instalar corretamente o PyInstaller

0

Algo correu mal durante a instalação, mas mesmo assim recebi uma mensagem de 'sucesso':

$ sudo pip3 install pyinstaller
[sudo] password for user: 
Downloading/unpacking pyinstaller
  Downloading PyInstaller-3.0.tar.gz (2.7MB): 2.7MB downloaded
  Running setup.py (path:/tmp/pip_build_root/pyinstaller/setup.py) egg_info for package pyinstaller

    warning: no files found matching '*.txt' under directory 'doc'
    warning: no previously-included files matching '*' found under directory 'bootloader/build'
    warning: no previously-included files matching '*' found under directory 'bootloader/.waf*'
    warning: no previously-included files matching '*' found under directory 'bootloader/waf3-*'
    warning: no previously-included files found matching 'bootloader/.lock-waf*'
    warning: no previously-included files matching '*' found under directory 'doc/source'
    warning: no previously-included files found matching 'doc/source'
    warning: no previously-included files matching '*' found under directory 'old'
    warning: no previously-included files found matching 'old'
    warning: no previously-included files matching '*' found under directory 'scripts'
    warning: no previously-included files found matching 'scripts'
    warning: no previously-included files matching '*' found under directory 'tests/scripts'
    warning: no previously-included files found matching 'tests/scripts'
    warning: no previously-included files found matching '.*'
    warning: no previously-included files found matching '*.yml'
    warning: no previously-included files matching '*.pyo' found anywhere in distribution
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python3/dist-packages (from pyinstaller)
Installing collected packages: pyinstaller
  Running setup.py install for pyinstaller

    warning: no files found matching '*.txt' under directory 'doc'
    warning: no previously-included files matching '*' found under directory 'bootloader/build'
    warning: no previously-included files matching '*' found under directory 'bootloader/.waf*'
    warning: no previously-included files matching '*' found under directory 'bootloader/waf3-*'
    warning: no previously-included files found matching 'bootloader/.lock-waf*'
    warning: no previously-included files matching '*' found under directory 'doc/source'
    warning: no previously-included files found matching 'doc/source'
    warning: no previously-included files matching '*' found under directory 'old'
    warning: no previously-included files found matching 'old'
    warning: no previously-included files matching '*' found under directory 'scripts'
    warning: no previously-included files found matching 'scripts'
    warning: no previously-included files matching '*' found under directory 'tests/scripts'
    warning: no previously-included files found matching 'tests/scripts'
    warning: no previously-included files found matching '.*'
    warning: no previously-included files found matching '*.yml'
    warning: no previously-included files matching '*.pyo' found anywhere in distribution
    Installing pyi-bindepend script to /usr/local/bin
    Installing pyi-grab_version script to /usr/local/bin
    Installing pyi-pprint_toc script to /usr/local/bin
    Installing pyinstaller script to /usr/local/bin
    Installing pyi-archive_viewer script to /usr/local/bin
    Installing pyi-makespec script to /usr/local/bin
    Installing pyi-set_version script to /usr/local/bin
      File "/usr/local/lib/python3.4/dist-packages/PyInstaller/lib/pefile_py2.py", line 82
        IMAGE_ORDINAL_FLAG              = 0x80000000L
                                                    ^
    SyntaxError: invalid syntax

Successfully installed pyinstaller
Cleaning up...

Depois de pyinstaller file.py , ocorreu um erro:

Traceback (most recent call last):
  File "/usr/local/bin/pyinstaller", line 9, in <module>
    load_entry_point('PyInstaller==3.0', 'console_scripts', 'pyinstaller')()
  File "/usr/local/lib/python3.4/dist-packages/PyInstaller/__main__.py", line 99, in run
    run_build(opts, spec_file, pyi_config)
  File "/usr/local/lib/python3.4/dist-packages/PyInstaller/__main__.py", line 47, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **opts.__dict__)
  File "/usr/local/lib/python3.4/dist-packages/PyInstaller/building/build_main.py", line 737, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "/usr/local/lib/python3.4/dist-packages/PyInstaller/building/build_main.py", line 680, in build
    exec(text, spec_namespace)
  File "<string>", line 16, in <module>
  File "/usr/local/lib/python3.4/dist-packages/PyInstaller/building/build_main.py", line 207, in __init__
    self.__postinit__()
  File "/usr/local/lib/python3.4/dist-packages/PyInstaller/building/datastruct.py", line 156, in __postinit__
    self.assemble()
  File "/usr/local/lib/python3.4/dist-packages/PyInstaller/building/build_main.py", line 428, in assemble
    imphook_object = ImportHook(imported_name, hook_file)
  File "/usr/local/lib/python3.4/dist-packages/PyInstaller/building/imphook.py", line 175, in __init__
    self._module = importlib_load_source(hook_modname, self._filename)
  File "/usr/local/lib/python3.4/dist-packages/PyInstaller/compat.py", line 492, in importlib_load_source
    return mod_loader.load_module()
  File "<frozen importlib._bootstrap>", line 539, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1614, in load_module
  File "<frozen importlib._bootstrap>", line 596, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 1220, in load
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/usr/local/lib/python3.4/dist-packages/PyInstaller/hooks/hook-Xlib.py", line 12, in <module>
    from PyInstaller import is_unix
ImportError: cannot import name 'is_unix'

(a propósito, é normal que eu precise usar sudo com pip3 , porque sem sudo eu não posso instalá-lo?)

    
por R S 11.12.2015 / 13:43

1 resposta

0

O erro de importação é devido a alguns dos módulos não detectados pelo pyinstaller. Você precisa incluir explicitamente importações ocultas para isso. link Confira isso para mais informações. Você pode verificar quais módulos não foram importados corretamente do arquivo de aviso gerado no diretório de criação do seu aplicativo.

    
por Rishikesh Jha 15.11.2016 / 10:48