labelImg.exe is unable to use the predefined_classes.txt
- **OS:**win10, python3.8
- **PyQt version:**12.11.0
Python labelImg.py works well, but labelImg.exe can not find the predefined_classes.txt.
Error info: QMimeDatabase: Error loading internal MIME data An error has been encountered at line 1 of <internal MIME data>: Premature end of document.: Not find:/data/predefined_classes.txt (optional)
data/predefined_classes.txt and labelImg.exe are in the same directory.
you need to embed /data file in the .exe file code: pyinstaller --hidden-import=pyqt5 --hidden-import=lxml -F -n "labelImg1" -c labelImg.py -p ./libs -p ./ --add-data " Your PATH/data;data/"
you need to embed /data file in the .exe file code: pyinstaller --hidden-import=pyqt5 --hidden-import=lxml -F -n "labelImg1" -c labelImg.py -p ./libs -p ./ --add-data " Your PATH/data;data/"
Hello, I tried your solution in terminal but didn't work:
'pyinstall' is not recognized as an internal or external command, operable program or batch file.
Could you please help me to solve it ?
you need to embed /data file in the .exe file code: pyinstaller --hidden-import=pyqt5 --hidden-import=lxml -F -n "labelImg1" -c labelImg.py -p ./libs -p ./ --add-data " Your PATH/data;data/"
Hello, I tried your solution in terminal but didn't work:
'pyinstall' is not recognized as an internal or external command, operable program or batch file.
Could you please help me to solve it ?
You need to put this command " python -m PyInstaller " before in terminal
The above operation fixes the predefine_classes.txt. If you want to change the path or file, type it below and run it
labelimg.exe class_file ./data/predefined_classes.txt