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

Pyinstaller issues #412

Closed
deepankarpal1985 opened this issue May 3, 2019 · 6 comments
Closed

Pyinstaller issues #412

deepankarpal1985 opened this issue May 3, 2019 · 6 comments

Comments

@deepankarpal1985
Copy link

deepankarpal1985 commented May 3, 2019

How to make this work with Pyinstaller

Gives this error
Traceback (most recent call last):
File "Temp_extractor.py", line 18, in
File "mesh_voxel.py", line 31, in voxelmesher2
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in load_unlocked
File "c:\users\dpal\appdata\local\continuum\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.dict)
File "site-packages\trimesh_init
.py", line 15, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in load_unlocked
File "c:\users\dpal\appdata\local\continuum\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.dict)
File "site-packages\trimesh\base.py", line 15, in
File "", line 983, in find_and_load
File "", line 967, in find_and_load_unlocked
File "", line 677, in load_unlocked
File "c:\users\dpal\appdata\local\continuum\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.dict)
File "site-packages\trimesh\units.py", line 15, in
File "site-packages\trimesh\resources_init
.py", line 20, in get_resource
File "site-packages\pkg_resources_init
.py", line 1157, in resource_string
File "site-packages\pkg_resources_init.py", line 1401, in get_resource_string
File "site-packages\pkg_resources_init.py", line 1540, in _get
File "c:\users\dpal\appdata\local\continuum\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 475, in get_data
with open(path, 'rb') as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\dpal\Documents\ansysdev\Pythonthermalsolver\dist\Temp_extractor\trimesh\resources\units_to_inches.json'
[15260] Failed to execute script Temp_extractor

@mikedh
Copy link
Owner

mikedh commented May 4, 2019

Oh interesting, it looks like pyinstaller isn't copying the files specified in the package_data field in setup.py.

This might be related. Maybe try some variant of adding trimesh/resources to MANIFEST.in?

@mikedh
Copy link
Owner

mikedh commented May 27, 2019

Added to requested enhancements list, closing for now.

@mikedh mikedh closed this as completed May 27, 2019
@mjd3
Copy link
Contributor

mjd3 commented Jun 14, 2019

Looks like adding include_package_data=True to setup.py could help with this (see answer here)?

@ericeasthope
Copy link

Have there been developments on this? AFAIK there isn't another clean way to use trimesh in production without support for pyinstaller. I wouldn't call support for production builds an "enhancement" ...

@mikedh
Copy link
Owner

mikedh commented Dec 27, 2019

Hey, most of the live applications using trimesh (including the ones I work on) run as backend services in docker containers. There are pre-built images based on debian:buster-slim on docker hub that are rebuilt on every release.

That being said, I would be happy to accept PR's to fix issues with pyinstaller and run it in unit tests.

@JOUV
Copy link

JOUV commented Apr 16, 2020

Hiya, I'm trying to compile a python script with pyinstaller and although I can get test files working, the script that used trimesh ends with this error when I try to run the exe:

"Traceback (most recent call last):
File "example.py", line 12, in
ModuleNotFoundError: No module named 'trimesh'
[25704] Failed to execute script example"

Any ideas on how to fix this? Is there a command switch to use with pyinstaller to force the use of trimesh? Currently all I'm using is "pyinstaller --onefile example.py".

warrenbocphet pushed a commit to warrenbocphet/pyinstaller-hooks-contrib that referenced this issue Aug 7, 2020
…o_inches.json in resources folder. This file goes undetected when using pyinstaller. Adding a hook solved the issue.

This issue is highlighted here: mikedh/trimesh#412
warrenbocphet pushed a commit to warrenbocphet/pyinstaller-hooks-contrib that referenced this issue Aug 7, 2020
…o_inches.json in resources folder. This file goes undetected when using pyinstaller. Adding a hook solved the issue.

This issue is highlighted here: mikedh/trimesh#412

edit: add an end of line for hook-trimesh.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants