Open shaform opened 7 years ago
You forget to run $ make
But Makefile
would not be installed by pip
.
If I run $ make
, the following message appears:
make: *** No targets specified and no makefile found. Stop.
Interestingly, the resources.py
file does exist.
$ ls env/lib/python3.5/site-packages/labelImg/resources.py
env/lib/python3.5/site-packages/labelImg/resources.py
If I install pyqt4
and manually import
>>> from labelImg import resources
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/$USER/env/lib/python3.5/site-packages/labelImg/resources.py", line 6316, in <module>
qInitResources()
File "/home/$USER/env/lib/python3.5/site-packages/labelImg/resources.py", line 6311, in qInitResources
QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
TypeError: qRegisterResourceData(int, str, str, str): argument 2 has unexpected type 'str'
If I install pyqt4
and sip
, we get segmentation fault.
$ labelImg
Segmentation fault (core dumped)
>>> from labelImg import resources
Segmentation fault (core dumped)
If I install pyqt5
and manually import
>>> from labelImg import resources
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/$USER/env/lib/python3.5/site-packages/labelImg/resources.py", line 10, in <module>
from PyQt4 import QtCore
ImportError: No module named 'PyQt4'
Hi @shaform , I think you can refer to the travis file to know the build and test env.
Otherwise, you can try to use docker or pip install it directly.
Hi @tzutalin,
Thank you. This is really helpful. Now I am able to reproduce my issue on Travis CI when using pip install
.
Please see https://travis-ci.org/shaform/labelImg/builds/248948327
Basically, I have modified the travis file to test against the labelImg package installed by pip instead of the one inside the repo, which shows us that the package uploaded to PyPI is potentially corrupted.
See diff: https://github.com/shaform/labelImg/commit/44a8c4a1116561a3c028c28ee8a60e4bb82381a7
Sorry! I was having this issue too. @shaform did you just end up installing directly from the repo or did @tzutalin reupload the PyPI?
@tungalbert99
I just re-run the travis-ci, and it still fails https://travis-ci.org/shaform/labelImg/builds/248948327. So the PyPI package is still broken.
I am able to run labelImg in the repo with system Python 3 with the following modification:
- self.recentFiles = list(settings.get('recentFiles', []))
+ self.recentFiles = list(settings.get('recentFiles') or [])
The command I used was:
$ sudo apt install python3-lxml pyqt5-dev-tools cmake
$ make qt5py3
$ python3 labelImg.py
Excuse me, is there are any corrections performed due to this issue? (I could miss, that`s why I`m asking). I`ve met the same problem despite of current issue being closed and I`d rather prefer to install labelImg
from PyPl package than from sources.
Same issue here with Python 2.7.
Why is this closed? I have the same issue with Python 3.6 on Ubuntu 16.04...
I can confirm the build still fails, as shown here: https://travis-ci.org/shaform/labelImg/builds/248948327. However, one could still build the package by herself rather than installing it from PyPI.
Same issue under Windows 7
and Python 3.6.1 |Anaconda 4.4.0 (64-bit)
Same issue on ubuntu 17.04 with python 3.6
一樣的問題 大概只能從原始碼安裝了
Same here, pip install and fails. I never see labelimg working with several methods:
Tried on Ubuntu 16.04LTS: pip install
worked but labelImg
returned the same error.
$ pip install labelImg
Collecting labelImg
Downloading labelImg-1.6.0.tar.gz (373kB)
100% |████████████████████████████████| 378kB 1.1MB/s
Building wheels for collected packages: labelImg
Running setup.py bdist_wheel for labelImg ... done
Stored in directory: /home/renwei/.cache/pip/wheels/b3/86/f3/517dffac32aeb789e2378b4aaba7b03f088b18ff166928f651
Successfully built labelImg
Installing collected packages: labelImg
Successfully installed labelImg-1.6.0
$ labelImg
Traceback (most recent call last):
File "/home/renwei/anaconda3/envs/ml/bin/labelImg", line 7, in <module>
from labelImg.labelImg import main
File "/home/renwei/anaconda3/envs/ml/lib/python3.6/site-packages/labelImg/labelImg.py", line 27, in <module>
import resources
ModuleNotFoundError: No module named 'resources'
If these issues haven't already been resolved, these were my changes to get the pip-installed version of labelImg to work (at least start) - python 3.5 running a virtualenv with other pre-reqs installed.
site-packages/labelImg/labelImg.py change line 27 "import resources" to "from labelImg import resources"
site-packages/labelImg/resources.py change line 12: qt_resource_data = "\ to qt_resource_data = b"\
Same for lines 6596 qt_resource_name = b"\ , and 6711, qt_resource_struct = b"\
Fires right up, but haven't really tested functionality yet.
@vitusTreatise
I followed your advice and got another error
Traceback (most recent call last): File "/usr/local/bin/labelImg", line 9, in
load_entry_point('labelImg==1.6.0', 'console_scripts', 'labelImg')() File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 542, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2569, in load_entry_point return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2229, in load return self.resolve() File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2235, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "/usr/local/lib/python3.5/dist-packages/labelImg/labelImg.py", line 27, in from labelImg import resources File "/usr/local/lib/python3.5/dist-packages/labelImg/resources.py", line 10, in from PyQt4 import QtCore ImportError: No module named 'PyQt4'
Installed pyqt4 sudo apt-get install python-qt4
Still no luck! The prebuilt binaries don't work, neither does pip installer but this issue is "closed". Can someone open this please.
@azmathmoosa
I have the same issue. Indeed can someone reopen?
I also experienced the issue "No module named 'resources'". I could solve it with separate calls to 'pip3 install' . See my Dockerfile or try the docker container if you work on linux.
@vitusTreatise solution works for me. Again, I haven't tested all functionality yet. @vitusTreatise have you confirmed it all works fine?
Hi, I have the same issue on Ubuntu 18.04 and Python 3.6.5, I installed it using pip, but the same error
no module named resources
@reiinakano - yes, worked fine in the context of what I was trying to accomplish, which was to learn something about tensorflow. Was following along with this tutorial:
https://www.youtube.com/watch?v=K_mFnvzyLvc
Did what was required after above modifications.
@azmathmoosa @benediktbrandt afaik the debian python-qt4
package is for python2. You are trying to use python3 though. If you don't want to stick with qt4 you could for instance use for instance pyqt5-dev-tools
via apt
. For qt4 i think libqt4-dev
should work, too.
I fell for it too. Perhaps wrapping the resources import into a try / except construct, and printing something like: "run make before starting labelimg" THX
On Ubuntu 16.04, do:
get: