Python Forum
barcodes scanner for kivy
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
barcodes scanner for kivy
#1
Does anyone know of another bar code scanner for Kivy?

I tried using this one but i get a key error when i test it and im wondering if this is even working anymore after 4 years.

Error:
[INFO   ] [Logger      ] Record log in /home/metulburr/.kivy/logs/kivy_17-04-19_1.txt [INFO   ] [Kivy        ] v1.9.1 [INFO   ] [Python      ] v2.7.12 (default, Nov 19 2016, 06:48:10)  [GCC 5.4.0 20160609] [INFO   ] [Factory     ] 179 symbols loaded [INFO   ] [Image       ] Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)  Traceback (most recent call last):    File "main.py", line 28, in <module>      from jnius import autoclass, PythonJavaClass, java_method, cast    File "/home/metulburr/.local/lib/python2.7/site-packages/jnius/__init__.py", line 13, in <module>      from .reflect import *  # noqa    File "/home/metulburr/.local/lib/python2.7/site-packages/jnius/reflect.py", line 14, in <module>      class Class(with_metaclass(MetaJavaClass, JavaClass)):    File "/usr/lib/python2.7/dist-packages/six.py", line 808, in __new__      return meta(name, bases, d)    File "jnius/jnius_export_class.pxi", line 43, in jnius.MetaJavaClass.__new__ (jnius/jnius.c:17219)    File "jnius/jnius_export_class.pxi", line 65, in jnius.MetaJavaClass.resolve_class (jnius/jnius.c:17615)    File "jnius/jnius_env.pxi", line 11, in jnius.get_jnienv (jnius/jnius.c:3320)    File "jnius/jnius_jvm_dlopen.pxi", line 90, in jnius.get_platform_jnienv (jnius/jnius.c:3248)    File "jnius/jnius_jvm_dlopen.pxi", line 45, in jnius.create_jnienv (jnius/jnius.c:2647)    File "/usr/lib/python2.7/UserDict.py", line 40, in __getitem__      raise KeyError(key)  KeyError: 'JAVA_HOME'
Actually i get that error for even just importing their dependency module jnius
metulburr@ubuntu:~$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import jnius
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/metulburr/.local/lib/python2.7/site-packages/jnius/__init__.py", line 13, in <module>
    from .reflect import *  # noqa
  File "/home/metulburr/.local/lib/python2.7/site-packages/jnius/reflect.py", line 14, in <module>
    class Class(with_metaclass(MetaJavaClass, JavaClass)):
  File "/usr/lib/python2.7/dist-packages/six.py", line 808, in __new__
    return meta(name, bases, d)
  File "jnius/jnius_export_class.pxi", line 43, in jnius.MetaJavaClass.__new__ (jnius/jnius.c:17219)
  File "jnius/jnius_export_class.pxi", line 65, in jnius.MetaJavaClass.resolve_class (jnius/jnius.c:17615)
  File "jnius/jnius_env.pxi", line 11, in jnius.get_jnienv (jnius/jnius.c:3320)
  File "jnius/jnius_jvm_dlopen.pxi", line 90, in jnius.get_platform_jnienv (jnius/jnius.c:3248)
  File "jnius/jnius_jvm_dlopen.pxi", line 45, in jnius.create_jnienv (jnius/jnius.c:2647)
  File "/usr/lib/python2.7/UserDict.py", line 40, in __getitem__
    raise KeyError(key)
KeyError: 'JAVA_HOME'
>>> 
Recommended Tutorials:
Reply
#2
I can't even pip install that dependency
Output:
$ sudo pip install jnius Collecting jnius  Using cached jnius-1.1.0.tar.gz Collecting six>=1.7.0 (from jnius) /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.  SNIMissingWarning /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.  InsecurePlatformWarning  Downloading six-1.10.0-py2.py3-none-any.whl Requirement already satisfied: cython in /usr/lib/pymodules/python2.7 (from jnius) Installing collected packages: six, jnius  Found existing installation: six 1.1.0    DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.    Uninstalling six-1.1.0:      Successfully uninstalled six-1.1.0  Running setup.py install for jnius ... error    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-KLx46Y/jnius/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-UrTzdD-record/install-record.txt --single-version-externally-managed --compile:    running install    running build    running build_py    creating build    creating build/lib.linux-armv7l-2.7    copying jnius_config.py -> build/lib.linux-armv7l-2.7    creating build/lib.linux-armv7l-2.7/jnius    copying jnius/__init__.py -> build/lib.linux-armv7l-2.7/jnius    copying jnius/reflect.py -> build/lib.linux-armv7l-2.7/jnius    copying jnius/signatures.py -> build/lib.linux-armv7l-2.7/jnius    running build_ext    cythoning jnius/jnius.pyx to jnius/jnius.c        Error compiling Cython file:    ------------------------------------------------------------    ...        ctypedef jlong const_jlong "const jlong"        ctypedef jfloat const_jfloat "const jfloat"        ctypedef jdouble const_jdouble "const jdouble"            ctypedef struct JNINativeMethod:            const char* name                     ^    ------------------------------------------------------------        jnius/jni.pxi:39:18: Syntax error in C variable declaration    building 'jnius' extension    creating build/temp.linux-armv7l-2.7    creating build/temp.linux-armv7l-2.7/jnius    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/include -I/usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/include/linux -I/usr/in    jnius/jnius.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.    error: command 'gcc' failed with exit status 1        ---------------------------------------- Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-KLx46Y/jnius/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-UrTzdD-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-KLx46Y/jnius/
Might be related to https://github.com/kivy/pyjnius/issues/219

Anyway, have you tried https://github.com/kivy/pyjnius/issues/2...-255604586 ?
Reply
#3
Quote:I can't even pip install that dependency
Thats odd as that is how i installed it

Wall have you ever felt like you were running around in circles?

Now i get this error, go figure.

Recommended Tutorials:
Reply
#4
That's really bizarre given that you had it working before. Have you installed Cython? Also, did you try the workaround on Github?
Reply
#5
Yeah i have cython installed yet it says its not.

Quote:Also, did you try the workaround on Github?
I did. But i didnt have anything different happen.
Recommended Tutorials:
Reply
#6
im wondering if its an architecture problem with the shared library provided in the repo?
Output:
...failed to import Cython: /home/metulburr/Downloads/android-zbar-qrcode-master/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/lib-dynload/_io.so: wrong ELF class: ELFCLASS32 ...
metulburr@ubuntu:~$ python -c 'import struct;print( 8 * struct.calcsize("P"))'
64
Recommended Tutorials:
Reply
#7
As much as i would like to get the barcode scanner to work. I dont really need the barcode. What i need is to read the numbers beneath the barcode. And i was assuming the barcode would have that information as well. But all i really need the numbers 130753708

Attached Files

Thumbnail(s)
   
Recommended Tutorials:
Reply
#8
I could be possible to read number from a image if that's what you thinking of?
I did some test many years ago with stuff like OpenCV,Tesseract,
could read car numbers from not to bad images of cars.
Reply
#9
I'm fairly confident that OCR should be harder than reading a barcode....
Reply
#10
probably is, i just cant seem to find any barcode scanners that actually work
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Kivy - OpenCollective - [Announcement] Kivy funding. buran 0 1,992 Feb-03-2019, 04:02 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020