When I want to integrate the yolo project file into an executable program that can be easily used by users, the program always reports an error: No module named ‘ultralytics’. The tool used is PyInstaller.
What tool can be used to integrate the yolo project file? Is there a relatively smooth tutorial?
Hi Wen_Liu,
Thanks for reaching out. Packaging complex libraries like ultralytics
with PyInstaller can sometimes require explicit guidance for the packager.
When PyInstaller reports “No module named ‘ultralytics’”, it often means it didn’t automatically detect the package as a dependency. You can usually resolve this by using the --hidden-import
flag when running PyInstaller.
Try building your executable like this:
pyinstaller your_script.py --hidden-import=ultralytics
Also, ensure you are using the latest versions of both ultralytics
and PyInstaller. You can update ultralytics
with pip install -U ultralytics
.
Questions regarding pyinstaller
should be directed to the developers of that package. You can also check out their documentation When Things Go Wrong — PyInstaller 6.13.0 documentation if you find a solution, you’re welcome to write about it in Community Showcase - Ultralytics