Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'exec_command' from 'PyInstaller.utils.hooks' #3689

Closed
tobinjones opened this issue Aug 21, 2018 · 5 comments

Comments

Projects
None yet
6 participants
@tobinjones
Copy link

commented Aug 21, 2018

Building a PySide2/QtQuick application with the development branch of pyinstaller gives the following error:

File "<snip>\PyInstaller\hooks\hook-PySide2.QtQuick.py", line 13, in <module>
   from PyInstaller.utils.hooks import get_qmake_path, exec_command
ImportError: cannot import name 'exec_command' from 'PyInstaller.utils.hooks' (<snip>\PyInstaller\utils\hooks\__init__.py)

(note: using Python3.7, Windows 10)

I suspect that hook-PySide2.QtQuick.py should instead be importing exec_command_stdout. Possibly related to issue #3089

@bjones1

This comment has been minimized.

Copy link
Member

commented Aug 21, 2018

Needs fixing! Please provide a PR.

@patrickelectric

This comment has been minimized.

Copy link

commented Nov 16, 2018

any update with this issue ?

patrickelectric added a commit to patrickelectric/pyinstaller that referenced this issue Nov 16, 2018

hooks: Update PySide2.QtQuick to use exec_command_stdout
Fix pyinstaller#3689

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>

cbenhagen added a commit to cbenhagen/pyinstaller that referenced this issue Mar 21, 2019

cbenhagen added a commit to cbenhagen/pyinstaller that referenced this issue Mar 21, 2019

@Vyeadiai

This comment has been minimized.

Copy link

commented Apr 11, 2019

I am experiencing this issue with PySide2.QtQuick.

4733 INFO: Loading module hook "hook-PySide2.QtQuick.py"...
Traceback (most recent call last):
File "/Users/ed/.pyenv/versions/3.5.7/bin/pyinstaller", line 11, in
sys.exit(run())
File "/Users/ed/.pyenv/versions/3.5.7/lib/python3.5/site-packages/PyInstaller/main.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "/Users/ed/.pyenv/versions/3.5.7/lib/python3.5/site-packages/PyInstaller/main.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/Users/ed/.pyenv/versions/3.5.7/lib/python3.5/site-packages/PyInstaller/building/build_main.py", line 838, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/Users/ed/.pyenv/versions/3.5.7/lib/python3.5/site-packages/PyInstaller/building/build_main.py", line 784, in build
exec(text, spec_namespace)
File "", line 17, in
File "/Users/ed/.pyenv/versions/3.5.7/lib/python3.5/site-packages/PyInstaller/building/build_main.py", line 241, in init
self.postinit()
File "/Users/ed/.pyenv/versions/3.5.7/lib/python3.5/site-packages/PyInstaller/building/datastruct.py", line 158, in postinit
self.assemble()
File "/Users/ed/.pyenv/versions/3.5.7/lib/python3.5/site-packages/PyInstaller/building/build_main.py", line 500, in assemble
module_hook.post_graph()
File "/Users/ed/.pyenv/versions/3.5.7/lib/python3.5/site-packages/PyInstaller/building/imphook.py", line 410, in post_graph
self._load_hook_module()
File "/Users/ed/.pyenv/versions/3.5.7/lib/python3.5/site-packages/PyInstaller/building/imphook.py", line 377, in _load_hook_module
self.hook_module_name, self.hook_filename)
File "/Users/ed/.pyenv/versions/3.5.7/lib/python3.5/site-packages/PyInstaller/compat.py", line 736, in importlib_load_source
return mod_loader.load_module()
File "", line 418, in _check_name_wrapper
File "", line 841, in load_module
File "", line 700, in load_module
File "", line 268, in _load_module_shim
File "", line 693, in _load
File "", line 673, in _load_unlocked
File "", line 697, in exec_module
File "", line 222, in _call_with_frames_removed
File "/Users/ed/.pyenv/versions/3.5.7/lib/python3.5/site-packages/PyInstaller/hooks/hook-PySide2.QtQuick.py", line 13, in
from PyInstaller.utils.hooks import get_qmake_path, exec_command
ImportError: cannot import name 'exec_command'

Any resolution on this? This has been blocking me for days with no end in sight. I have tried with multiple versions of Python. Thanks

@adynathos

This comment has been minimized.

Copy link

commented May 10, 2019

The pull request #4206 solves the problem, I am able to package a PySide2 program successfully. Thank you very much for the fix.

Until this gets merged, you can install the fixed version from this branch: https://github.com/sjackso/pyinstaller/tree/fix_3689

@bjones1

This comment has been minimized.

Copy link
Member

commented May 12, 2019

This was fixed in 5b57912. Please reopen if there are still problems.

@bjones1 bjones1 closed this May 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.