-
Notifications
You must be signed in to change notification settings - Fork 79
Description
英文版(English version)
I uploaded the code to Docker, and there were no errors reported. There was only one line: Aborted (core dumped)
Based on the logs and other issues, the potential source of the program error seems to be the filter. Below is the filter I used in the code that may have caused the program error.
meshing_decimation_quadric_edge_collapse_with_texture,meshing_decimation_quadric_edge_collapse,apply_texmap_defragmentation
In addition, I have also used pyinstaller to attempt to package the code into executable files on both Windows and Linux systems (the program runs normally in the conda virtual environment on both systems). However, there were issues during packaging, and when the program was run, it displayed that some libraries had not been successfully packaged (even using --hidden-import had no effect). Based on my personal analysis, as well as research and communication with GPT, it may be a problem with dynamic library linking. On Windows, the pymeshlab library was directly dragged from the site-packages directory to the executable program directory (using the parameter -D: to create a directory containing the exe file, but it relies on many files). Although this made the program much larger (because many unnecessary modules from the pymeshlab library were added), the same operation did not work on Linux, resulting in some other errors.
The following is the packaging log of the program using pyinstaller on a Linux system:
(pymeshlab-linux) user@DESKTOP-O31HG2L:~/Mesh_Simplification/pymeshlab_simplify_package_v2.1$ pyinstaller -D -c pymeshlab_simplify.py --add-data "input*:input" --hidden-import "numpy" --hidden-import "pymeshlab"
153 INFO: PyInstaller: 5.13.2
153 INFO: Python: 3.7.12 (conda)
153 INFO: Platform: Linux-6.6.87.1-microsoft-standard-WSL2-x86_64-with-debian-bookworm-sid
153 INFO: wrote /home/user/Mesh_Simplification/pymeshlab_simplify_package_v2.1/pymeshlab_simplify.spec
198 INFO: Extending PYTHONPATH with paths
['/home/user/Mesh_Simplification/pymeshlab_simplify_package_v2.1']
310 INFO: Appending 'datas' from .spec
311 INFO: checking Analysis
312 INFO: Building Analysis because Analysis-00.toc is non existent
312 INFO: Initializing module dependency graph...
312 INFO: Caching module graph hooks...
318 INFO: Analyzing base_library.zip ...
1102 INFO: Loading module hook 'hook-encodings.py' from '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks'...
1488 INFO: Loading module hook 'hook-pickle.py' from '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks'...
1519 INFO: Loading module hook 'hook-heapq.py' from '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks'...
2171 INFO: Caching module dependency graph...
2239 INFO: running Analysis Analysis-00.toc
2247 INFO: Analyzing /home/user/Mesh_Simplification/pymeshlab_simplify_package_v2.1/pymeshlab_simplify.py
2256 INFO: Loading module hook 'hook-trimesh.py' from '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
2279 INFO: Loading module hook 'hook-numpy.py' from '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks'...
2290 WARNING: Conda distribution 'numpy', dependency of 'numpy', was not found. If you installed this distribution with pip then you may ignore this warning.
2536 INFO: Loading module hook 'hook-difflib.py' from '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks'...
2604 INFO: Loading module hook 'hook-platform.py' from '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks'...
2745 INFO: Loading module hook 'hook-sysconfig.py' from '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks'...
3516 INFO: Loading module hook 'hook-PIL.py' from '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks'...
3581 INFO: Loading module hook 'hook-PIL.Image.py' from '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks'...
4004 INFO: Loading module hook 'hook-packaging.py' from '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks'...
4023 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks'...
4221 INFO: Loading module hook 'hook-pkg_resources.py' from '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks'...
4699 INFO: Loading module hook 'hook-xml.py' from '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks'...
4984 INFO: Processing module hooks...
5244 WARNING: Hidden import "six" not found!
5359 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks'...
5392 INFO: Looking for ctypes DLLs
5398 INFO: Analyzing run-time hooks ...
5400 INFO: Including run-time hook '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py'
5402 INFO: Including run-time hook '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py'
5402 INFO: Including run-time hook '/home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgres.py'
5413 INFO: Looking for dynamic libraries
670 WARNING: Cannot find libgfortran-2e0d59d6.so.5.0.0 (needed by /home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/numpy/core/../../numpy.libs/libopenblasp-r0-2d23e62b.3.17.so)
676 WARNING: Cannot find libquadmath-2d0c479f.so.0.0.0 (needed by /home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/numpy/core/../../numpy.libs/libgfortran-2e0d59d6.so.5.0.0)
682 WARNING: Cannot find libwebp-3ee34a0b.so.7.1.6 (needed by /home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PIL/../Pillow.libs/libwebpmux-ddfacf1d.so.3.0.11)
694 WARNING: Cannot find libsharpyuv-9340467d.so.0.0.0 (needed by /home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PIL/../Pillow.libs/libwebp-3ee34a0b.so.7.1.6)
700 WARNING: Cannot find libwebp-3ee34a0b.so.7.1.6 (needed by /home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PIL/../Pillow.libs/libwebpdemux-785dd7eb.so.2.0.12)
712 WARNING: Cannot find liblzma-95592ee6.so.5.4.2 (needed by /home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PIL/../Pillow.libs/libtiff-b9364ff1.so.6.0.0)
712 WARNING: Cannot find libjpeg-f2134fdd.so.62.3.0 (needed by /home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PIL/../Pillow.libs/libtiff-b9364ff1.so.6.0.0)
718 WARNING: Cannot find libXau-154567c4.so.6.0.0 (needed by /home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PIL/../Pillow.libs/libxcb-3e83370d.so.1.1.0)
748 WARNING: Cannot find libpng16-cb42a3c6.so.16.39.0 (needed by /home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PIL/../Pillow.libs/libfreetype-cb9caf6f.so.6.19.0)
748 WARNING: Cannot find libbrotlidec-db4b3db6.so.1.0.9 (needed by /home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PIL/../Pillow.libs/libfreetype-cb9caf6f.so.6.19.0)
765 WARNING: Cannot find libfreetype-cb9caf6f.so.6.19.0 (needed by /home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PIL/../Pillow.libs/libharfbuzz-3543f599.so.0.60710.0)
771 WARNING: Cannot find libbrotlicommon-92722cb2.so.1 (needed by /home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PIL/../Pillow.libs/libbrotlidec-db4b3db6.so.1.0.9)
6276 INFO: Looking for eggs
6277 INFO: Using Python library /home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/pymeshlab/lib/libpython3.7m.so.1.0
6285 INFO: Warnings written to /home/user/Mesh_Simplification/pymeshlab_simplify_package_v2.1/build/pymeshlab_simplify/warn-pymeshlab_simplify.txt
6317 INFO: Graph cross-reference written to /home/user/Mesh_Simplification/pymeshlab_simplify_package_v2.1/build/pymeshlab_simplify/xref-pymeshlab_simplify.html
6333 INFO: checking PYZ
6333 INFO: Building PYZ because PYZ-00.toc is non existent
6333 INFO: Building PYZ (ZlibArchive) /home/user/Mesh_Simplification/pymeshlab_simplify_package_v2.1/build/pymeshlab_simplify/PYZ-00.pyz
6725 INFO: Building PYZ (ZlibArchive) /home/user/Mesh_Simplification/pymeshlab_simplify_package_v2.1/build/pymeshlab_simplify/PYZ-00.pyz completed successfully.
6733 INFO: checking PKG
6733 INFO: Building PKG because PKG-00.toc is non existent
6733 INFO: Building PKG (CArchive) pymeshlab_simplify.pkg
6747 INFO: Building PKG (CArchive) pymeshlab_simplify.pkg completed successfully.
6748 INFO: Bootloader /home/user/tool/miniconda3/envs/pymeshlab-linux/lib/python3.7/site-packages/PyInstaller/bootloader/Linux-64bit-intel/run
6748 INFO: checking EXE
6748 INFO: Building EXE because EXE-00.toc is non existent
6748 INFO: Building EXE from EXE-00.toc
6748 INFO: Copying bootloader EXE to /home/user/Mesh_Simplification/pymeshlab_simplify_package_v2.1/build/pymeshlab_simplify/pymeshlab_simplify
6748 INFO: Appending PKG archive to custom ELF section in EXE
6759 INFO: Building EXE from EXE-00.toc completed successfully.
6761 INFO: checking COLLECT
6761 INFO: Building COLLECT because COLLECT-00.toc is non existent
6762 INFO: Building COLLECT COLLECT-00.toc
6894 INFO: Building COLLECT COLLECT-00.toc completed successfully.The following is the error message displayed when the program runs without dragging the dependent library into the executable program directory:
(pymeshlab-linux) user@DESKTOP-O31HG2L:~/Mesh_Simplification/pymeshlab_simplify_package_v2.1$ ./dist/pymeshlab_simplify/pymeshlab_simplify --input_path input/tile_obj/Tile_+014_+004_20_000000.obj --output_path output/tile_obj_lab/Tile_+014_+004_20_000000.obj
Warning:
Unable to load the following plugins:
pmeshlab.cpython-37m-x86_64-linux-gnu.so: pmeshlab.cpython-37m-x86_64-linux-gnu.so does not seem to be a Qt Plugin.
Failed to extract plugin meta data from '/home/user/Mesh_Simplification/pymeshlab_simplify_package_v2.1/dist/pymeshlab_simplify/pymeshlab/pmeshlab.cpython-37m-x86_64-linux-gnu.so'
Start loading the model ..
Traceback (most recent call last):
File "pymeshlab_simplify.py", line 124, in <module>
pymeshlab_simplify()
File "pymeshlab_simplify.py", line 94, in pymeshlab_simplify
ms = load_mesh(args)
File "utils/mesh_processing.py", line 11, in load_mesh
ms.load_new_mesh(args.input_path)
pymeshlab.pmeshlab.PyMeshLabException: Unknown format for load: obj
[4204] Failed to execute script 'pymeshlab_simplify' due to unhandled exception!
(pymeshlab-linux) user@DESKTOP-O31HG2L:~/Mesh_Simplification/pymeshlab_simplify_package_v2.1$The following is the error message displayed when the program runs after dragging the dependent libraries (including PIL[pillow], numpy, pymeshlab, trimesh, and trimesh-4.4.1.dist-info) into the executable program's directory. The error message is consistent with that displayed in the Docker container:
(pymeshlab-linux) user@DESKTOP-O31HG2L:~/Mesh_Simplification/pymeshlab_simplify_package_v2.1$ ./dist/pymeshlab_simplify/pymeshlab_simplify --input_path input/tile_obj/Tile_+014_+004_20_000000.obj --output_path output/tile_obj_lab/Tile_+014_+004_20_000000.obj
Start loading the model ..
Model and texture information loaded successfully
Start simplifying the grid ..
Aborted (core dumped)
(pymeshlab-linux) user@DESKTOP-O31HG2L:~/Mesh_Simplification/pymeshlab_simplify_package_v2.1$How should the above problems be solved? If it cannot be solved, can you provide a solution to package it into an executable program or facilitate its propagation so that it can run directly on different operating systems and computers without Python environment (just like I plan to package it into an executable file or Docker, if only Linux system is available, because currently only Linux system executable files are needed)?