labelImg crashes at launch when installed as an app on macOS

Created on 1 Jul 2018  路  4Comments  路  Source: tzutalin/labelImg

Hello I tried to follow the instructions in the README.rst to install labelImg as an app on macOS but I have the following error message "_labelImg has encountered a fatal error, and will now terminate._" when I am trying to launch it once I successfully completed the installation:

screen shot 2018-07-01 at 19 51 34

I used this manual installation:

brew install python3
pip install pipenv
pipenv --three
pipenv shell
pip install py2app
pip install PyQt5 lxml
make qt5py3
rm -rf build dist
python setup.py py2app -A
mv "dist/labelImg.app" /Applications

Moreover, I had to modify my ~/.bash_profile. to solve a localization problem when using pipenv --three. I added the following lines (source):

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

I don't know if this could be the problem or not but I am also using Anaconda and therefore my python version is the following: Python 3.6.5 :: Anaconda, Inc.

Thanks a lot for your time.

  • OS: macOS High Sierra 10.13.15
  • PyQt version: PyQt5

Most helpful comment

I was able to get this running:
Execute these:
brew install python3
pip install pipenv
pipenv --three
pipenv shell
pip install py2app
pip install PyQt5 lxml
Unzip the labelImg downloaded from聽https://github.com/tzutalin/labelImg ,聽and execute the following
cd labelImg-master
brew install qt qt5
brew install libxml2
brew install pyqt5
make qt5py3
rm -rf build dist
python setup.py py2app -A
mv "dist/labelImg.app" /Applications
this should fix it.

All 4 comments

Thanks for bringing this to our attention, I'll try to take a look into it when I get the chance.

But in the meantime I would recommend running labelImg from the "Python 3 + Qt5 (Works on macOS High Sierra)" instructions here

Has there been any progress on this issue?

I was able to get this running:
Execute these:
brew install python3
pip install pipenv
pipenv --three
pipenv shell
pip install py2app
pip install PyQt5 lxml
Unzip the labelImg downloaded from聽https://github.com/tzutalin/labelImg ,聽and execute the following
cd labelImg-master
brew install qt qt5
brew install libxml2
brew install pyqt5
make qt5py3
rm -rf build dist
python setup.py py2app -A
mv "dist/labelImg.app" /Applications
this should fix it.

I encountered the same error message.

This happens if the python framework is not found when running py2app.

So what I recommend is like the following:

  1. copy libpython3.6m.pylib and libpython3.6m.a to libpython3.6.pylib and libpython3.6.a
    -> Those files are located on your anaconda python virtual environment, like User/user/anaconda3/envs/LabelImg/lib/ in my case.
    Note, LabelImg is the name of the virtual env. So, it may be different in your case.
  2. run setup again, like "$ python setup.py py2app"
    -> You can check if it works by running "open ./dist/labelImg.app/". If it works then, move the app to /Applications folder.

This is how I fix the issue.

Was this page helpful?
0 / 5 - 0 ratings