enthought / enthought/mayavi

Use pyinstaller to get a standalone Windows executable built with Mayavi?

Open
#1,142 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

1. python file

```
from mayavi import mlab
print("mayaviTest")

```

2. spec file

```
# -*- mode: python ; coding: utf-8 -*-
import sys
sys.path.append(r'D:\Software\python3.7.9\Lib\site-packages')
from PyInstaller.compat import is_win, is_darwin, is_linux
from PyInstaller.utils.hooks import collect_submodules

block_cipher = None

a = Analysis(['MayaviTest.py'],
pathex=[r'D:\Software\python3.7.9\Lib\site-packages'],
binaries=[(r'D:/Software/python3.7.9/Lib/site-packages/traitsui', 'mayalib\\traitsui'),
('D:/Software/python3.7.9/Lib/site-packages/traitsui-7.2.1-py3.7.egg-info','mayalib\\traitsui-7.2.1-py3.7.egg-info'),
('D:/Software/python3.7.9/Lib/site-packages/pyface', 'mayalib\\pyface'),
('D:/Software/python3.7.9/Lib/site-packages/pyface-7.3.0-py3.7.egg-info','mayalib\\pyface-7.3.0-py3.7.egg-info'),
('D:/Software/python3.7.9/Lib/site-packages/wx', 'mayalib\\wx'),
('D:/Software/python3.7.9/Lib/site-packages/wxPython-4.1.1.dist-info','mayalib\\wxPython-4.1.1.dist-info'),
('D:/Software/python3.7.9/Lib/site-packages/traits', 'mayalib\\traits'),
('D:/Software/python3.7.9/Lib/site-packages/traits-6.3.2.dist-info','mayalib\\traits-6.3.2.dist-info'),
('D:/Software/python3.7.9/Lib/site-packages/numpy', 'mayalib\\numpy'),
('D:/Software/python3.7.9/Lib/site-packages/numpy-1.21.1.dist-info','mayalib\\numpy-1.21.1.dist-info'),
('D:/Software/python3.7.9/Lib/site-packages/mayavi', 'mayalib\\mayavi'),
('D:/Software/python3.7.9/Lib/site-packages/mayavi-4.7.4-py3.7.egg-info','mayalib\\mayavi-4.7.4-py3.7.egg-info'),
('D:/Software/python3.7.9/Lib/site-packages/apptools', 'mayalib\\apptools'),
('D:/Software/python3.7.9/Lib/site-packages/apptools-5.1.0-py3.7.egg-info','mayalib\\apptools-5.1.0-py3.7.egg-info'),
('D:/Software/python3.7.9/Lib/site-packages/vtk-9.1.0.dist-info','mayalib\\vtk-9.1.0.dist-info'),
('D:/Software/python3.7.9/Lib/site-packages/tvtk','mayalib\\tvtk'),
('D:/Software/python3.7.9/Lib/site-packages/vtkmodules','mayalib\\vtkmodules'),
('D:/Software/python3.7.9/Lib/site-packages/tornado','mayalib\\tornado'),
('D:/Software/python3.7.9/Lib/site-packages/tornado-6.1.dist-info','mayalib\\tornado-6.1.dist-info'),
],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)

exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='MayaviTest',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None )
```

3. when i click my exe,it occured
Traceback (most recent call last):
File "PyScript\MayaviTest.py", line 1, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
File "mayavi\mlab.py", line 16, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
File "mayavi\tools\camera.py", line 24, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
File "mayavi\tools\engine_manager.py", line 12, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
File "mayavi\preferences\api.py", line 4, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
File "mayavi\preferences\preference_manager.py", line 29, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
File "traitsui\api.py", line 256, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
File "traitsui\editors\__init__.py", line 16, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
File "traitsui\editors\api.py", line 86, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
File "traitsui\editors\code_editor.py", line 21, in
File "traitsui\editors\code_editor.py", line 33, in CodeEditor
File "traits\trait_factory.py", line 40, in __call__
File "traitsui\toolkit_traits.py", line 43, in ColorTrait
File "traitsui\toolkit.py", line 110, in toolkit
File "pyface\base_toolkit.py", line 285, in find_toolkit
File "importlib_metadata\__init__.py", line 440, in __getitem__
KeyError: 'traitsui.toolkits'
4. env
win 10
python 3.7.9

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.