kivy-garden / zbarcam

Real time Barcode and QR Code scanner
MIT License
129 stars 33 forks source link

'NoneType' object has no attribute 'shape' #64

Open Zen-CODE opened 3 years ago

Zen-CODE commented 3 years ago

When trying the run the example with a checkout built from latest master. I get the error below. This is running on Kubuntu 20.04 LTS.

Exception has occurred: BuilderException
Parser: File "/home/richard/.pyenv/versions/3.7.5/envs/btp_game_3.7.5/lib/python3.7/site-packages/kivy_garden/xcamera/xcamera.kv", line 27:
...
     25:
     26:    id: camera
>>   27:    resolution: 640, 480 # 1920, 1080
     28:    allow_stretch: True
     29:
...
AttributeError: 'NoneType' object has no attribute 'shape'
  File "/home/richard/.pyenv/versions/3.7.5/envs/btp_game_3.7.5/lib/python3.7/site-packages/kivy/lang/builder.py", line 705, in _apply_rule
    setattr(widget_set, key, value)
  File "kivy/weakproxy.pyx", line 35, in kivy.weakproxy.WeakProxy.__setattr__
  File "kivy/properties.pyx", line 498, in kivy.properties.Property.__set__
  File "kivy/properties.pyx", line 840, in kivy.properties.ListProperty.set
  File "kivy/properties.pyx", line 545, in kivy.properties.Property.set
  File "kivy/properties.pyx", line 600, in kivy.properties.Property.dispatch
  File "kivy/_event.pyx", line 1248, in kivy._event.EventObservers.dispatch
  File "kivy/_event.pyx", line 1154, in kivy._event.EventObservers._dispatch
  File "/home/richard/.pyenv/versions/3.7.5/envs/btp_game_3.7.5/lib/python3.7/site-packages/kivy_garden/xcamera/xcamera.py", line 85, in _on_index
    self._on_index_dispatch(*largs)
  File "/home/richard/.pyenv/versions/3.7.5/envs/btp_game_3.7.5/lib/python3.7/site-packages/kivy_garden/xcamera/xcamera.py", line 88, in _on_index_dispatch
    super()._on_index(*largs)
  File "/home/richard/.pyenv/versions/3.7.5/envs/btp_game_3.7.5/lib/python3.7/site-packages/kivy/uix/camera.py", line 104, in _on_index
    resolution=self.resolution, stopped=True)
  File "/home/richard/.pyenv/versions/3.7.5/envs/btp_game_3.7.5/lib/python3.7/site-packages/kivy/core/camera/camera_opencv.py", line 70, in __init__
    super(CameraOpenCV, self).__init__(**kwargs)
  File "/home/richard/.pyenv/versions/3.7.5/envs/btp_game_3.7.5/lib/python3.7/site-packages/kivy/core/camera/__init__.py", line 70, in __init__
    self.init_camera()
  File "/home/richard/.pyenv/versions/3.7.5/envs/btp_game_3.7.5/lib/python3.7/site-packages/kivy/core/camera/camera_opencv.py", line 120, in init_camera
    self._resolution = (int(frame.shape[1]), int(frame.shape[0]))

During handling of the above exception, another exception occurred:

  File "/home/richard/Repos/zbarcam/src/main.py", line 31, in build
    return Builder.load_string(DEMO_APP_KV_LANG)
  File "/home/richard/Repos/zbarcam/src/main.py", line 35, in <module>
    DemoApp().run()

All builds fine, and I am able to use the webcom with cheese no problems. When I run make and make test, I get:

py37 installdeps: -r/home/richard/Repos/zbarcam/requirements.txt
ERROR: invocation failed (exit code 1), logfile: /home/richard/Repos/zbarcam/.tox/py37/log/py37-1.log
===================================================== log start ======================================================
Traceback (most recent call last):
  File "/home/richard/.pyenv/versions/3.7.5/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/richard/.pyenv/versions/3.7.5/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/richard/Repos/zbarcam/.tox/py37/lib/python3.7/site-packages/pip/__main__.py", line 16, in <module>
    from pip._internal.cli.main import main as _main  # isort:skip # noqa
  File "/home/richard/Repos/zbarcam/.tox/py37/lib/python3.7/site-packages/pip/_internal/cli/main.py", line 10, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/home/richard/Repos/zbarcam/.tox/py37/lib/python3.7/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/home/richard/Repos/zbarcam/.tox/py37/lib/python3.7/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
    from pip._internal.cli import cmdoptions
  File "/home/richard/Repos/zbarcam/.tox/py37/lib/python3.7/site-packages/pip/_internal/cli/cmdoptions.py", line 24, in <module>
    from pip._internal.exceptions import CommandError
  File "/home/richard/Repos/zbarcam/.tox/py37/lib/python3.7/site-packages/pip/_internal/exceptions.py", line 10, in <module>
    from pip._vendor.six import iteritems
ModuleNotFoundError: No module named 'pip._vendor.six'

====================================================== log end =======================================================
ERROR: could not install deps [-r/home/richard/Repos/zbarcam/requirements.txt]; v = InvocationError('/home/richard/Repos/zbarcam/.tox/py37/bin/python -m pip install -r/home/richard/Repos/zbarcam/requirements.txt', 1)
______________________________________________________ summary _______________________________________________________
  pep8: commands succeeded
ERROR:   isort-check: commands failed
  py36: commands succeeded
ERROR:   py37: could not install deps [-r/home/richard/Repos/zbarcam/requirements.txt]; v = InvocationError('/home/richard/Repos/zbarcam/.tox/py37/bin/python -m pip install -r/home/richard/Repos/zbarcam/requirements.txt', 1)
make: *** [Makefile:62: test] Error 1