PyInstaller EXE Fails Due to ansys-tools-path Metadata Error (PackageNotFoundError) #3849
Unanswered
aidenwang2004
asked this question in
Q&A
Replies: 1 comment
-
for anybody who are having the same problem, this is the command: pyinstaller --noconfirm --onedir --console --windowed --name AltoAutoTest --hidden-import=ansys.mapdl.core --hidden-import=ansys.tools.path --hidden-import=importlib_metadata --collect-submodules ansys.mapdl --collect-submodules ansys.tools.path --collect-submodules pyvista --collect-submodules vtk --collect-data ansys.api.mapdl --collect-data ansys.tools.path --copy-metadata ansys-tools-path --copy-metadata pyansys-tools-versioning ` launcher.py |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Team,
I'm a student developer working on a project using ansys-mapdl-core to automate FEA workflows (via a student-led toolset called AltoAuto). I'm running into an issue when trying to package the tool into an .exe using PyInstaller.
My Python code runs perfectly on its own — including calls like:
from ansys.mapdl.core import launch_mapdl
But when I convert the script into an .exe, I get this error at runtime:
importlib.metadata.PackageNotFoundError: No package metadata was found for ansys-tools-path
What I've tried:
Adding --hidden-import=ansys.tools.path and --hidden-import=importlib_metadata
Installing ansys-tools-path via pip install ansys-tools-path
Using a .spec file and adding collect_submodules('ansys.tools.path') and collect_data_files('ansys.tools.path')
Running with and without onefile mode
Ensuring ansys.mapdl.core and dependencies are all properly installed in the virtualenv
No matter what, the .exe fails silently or crashes with the metadata error.
Question:
How should I package a tool using ansys-mapdl-core with PyInstaller so that ansys-tools-path is properly bundled (or skipped if not needed)? Are there special considerations for importlib.metadata or pyproject.toml-based metadata resolution?
Any help would mean a lot — I’m close to launch and just stuck on this one final conversion step.
Thanks!

Aiden Wang
altoauto.net
Beta Was this translation helpful? Give feedback.
All reactions