enthought / enthought/traitsui

qt4 toolkit plugin not found when using pyinstaller

Open
#458 37 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

I'm not sure if this would fit better under pyinstaller or traitsui, but essentially when I try to build an exe using pyinstaller the resultant exe file raises an exception:

`RuntimeError: No traitsui.toolkits plugin found for toolkit qt4`

The first two lines of my program are:
```
from traits.etsconfig.api import ETSConfig
ETSConfig.toolkit = 'qt4'
```

The program works fine when run in a python environment, so think I just need to add a hidden-import, but I can't find what file it would be looking for since there is no toolkits folder or toolkits.py file in the traitsui folder, but there is a qt4 folder. It just doesn't seem to be looking there.

For reference, I am attempting to import mayavi but it always gets stuck on this step. Before I added the ETSConfig line, it was the same error but with null instead of qt4. The whole traceback is below:

```
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "c:\program files\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\mayavi\mlab.py", line 27, in
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "c:\program files\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\mayavi\tools\camera.py", line 24, in
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "c:\program files\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\mayavi\tools\engine_manager.py", line 12, in
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "c:\program files\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\mayavi\preferences\api.py", line 4, in
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "c:\program files\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\mayavi\preferences\preference_manager.py", line 29, in
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "c:\program files\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\traitsui\api.py", line 36, in
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "c:\program files\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\traitsui\editors\__init__.py", line 23, in
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "c:\program files\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\traitsui\editors\api.py", line 24, in
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "c:\program files\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\traitsui\editors\code_editor.py", line 37, in
File "site-packages\traitsui\editors\code_editor.py", line 49, in ToolkitEditorFactory
File "site-packages\traits\traits.py", line 522, in __call__
File "site-packages\traits\traits.py", line 1236, in Color
File "site-packages\traitsui\toolkit_traits.py", line 8, in ColorTrait
File "site-packages\traitsui\toolkit.py", line 109, in toolkit
File "site-packages\pyface\base_toolkit.py", line 263, in find_toolkit
File "site-packages\pyface\base_toolkit.py", line 209, in import_toolkit
RuntimeError: No traitsui.toolkits plugin found for toolkit qt4
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.