Posts: 5,150
Threads: 396
Joined: Sep 2016
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:
Posts: 2,343
Threads: 62
Joined: Sep 2016
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 ?
Posts: 5,150
Threads: 396
Joined: Sep 2016
Apr-20-2017, 12:14 AM
(This post was last modified: Apr-20-2017, 12:14 AM by metulburr.)
Quote:I can't even pip install that dependency
Thats odd as that is how i installed it
have you ever felt like you were running around in circles?
Now i get this error, go figure.
Output: metulburr@ubuntu:~/Downloads/android-zbar-qrcode-master$ buildozer android debug deploy run
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian 'dpkg' package management program version 1.18.4 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
# -> found at /usr/bin/git
# Search for Cython (cython)
# -> found at /usr/local/bin/cython
# Search for Java compiler (javac)
# -> found at /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
# -> found at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool
# Install platform
# Apache ANT found at /home/metulburr/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/metulburr/.buildozer/android/platform/android-sdk-20
# Android NDK found at /home/metulburr/.buildozer/android/platform/android-ndk-r9c
# Check application requirements
# Run './distribute.sh -l'
# Cwd /home/metulburr/Downloads/android-zbar-qrcode-master/.buildozer/android/platform/python-for-android
Available modules: android apsw audiostream bidi boost cherrypy c_igraph click cprotobuf cymunk django docutils ecdsa enum34 evdev ffmpeg ffmpeg2 ffpyplayer ffpyplayer_tito flask freetype gevent greenlet harfbuzz hostpython igraph itsdangerous jinja2 jpeg kivent_core kivent_cymunk kivy leveldb libevent libpq libsodium libswift libtorrent libxml2 libxslt libyaml lxml m2crypto markupsafe midistream msgpack mysql_connector netifaces numpy opencv openssl paramiko pil plyer plyvel png polygon protobuf psutil psycopg2 pyasn1 pycrypto pygame pyjnius pylibpd pyopenssl pyparsing pyqrcode python pyyaml sdl setuptools six sqlalchemy sqlite3 storm swift thrift twisted txws werkzeug wokkel zeroconf zope
# Application requirements already installed, pass
# Check garden requirements
# Compile platform
# Run './distribute.sh -l'
# Cwd /home/metulburr/Downloads/android-zbar-qrcode-master/.buildozer/android/platform/python-for-android
Available modules: android apsw audiostream bidi boost cherrypy c_igraph click cprotobuf cymunk django docutils ecdsa enum34 evdev ffmpeg ffmpeg2 ffpyplayer ffpyplayer_tito flask freetype gevent greenlet harfbuzz hostpython igraph itsdangerous jinja2 jpeg kivent_core kivent_cymunk kivy leveldb libevent libpq libsodium libswift libtorrent libxml2 libxslt libyaml lxml m2crypto markupsafe midistream msgpack mysql_connector netifaces numpy opencv openssl paramiko pil plyer plyvel png polygon protobuf psutil psycopg2 pyasn1 pycrypto pygame pyjnius pylibpd pyopenssl pyparsing pyqrcode python pyyaml sdl setuptools six sqlalchemy sqlite3 storm swift thrift twisted txws werkzeug wokkel zeroconf zope
# Clean and build python-for-android
# Remove directory and subdirectory /home/metulburr/Downloads/android-zbar-qrcode-master/.buildozer/android/platform/python-for-android/dist/qrcodeexample
# Run './distribute.sh -m "kivy" -d "qrcodeexample"'
# Cwd /home/metulburr/Downloads/android-zbar-qrcode-master/.buildozer/android/platform/python-for-android
Check build dependencies for Ubuntu
Check environment
SDK located at /home/metulburr/.buildozer/android/platform/android-sdk-20
NDK located at /home/metulburr/.buildozer/android/platform/android-ndk-r9c
NDK version is r9c
API level set to 19
Check NDK location
Check mandatory tools
Distribution will be located at /home/metulburr/Downloads/android-zbar-qrcode-master/.buildozer/android/platform/python-for-android/dist/qrcodeexample
Entering in ARM environment
Compiler found at /home/metulburr/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin//arm-linux-androideabi-gcc
PATH is /home/metulburr/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/:/home/metulburr/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/:/home/metulburr/.buildozer/android/platform/android-ndk-r9c:/home/metulburr/.buildozer/android/platform/android-sdk-20/tools:/home/metulburr/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/lib/jvm/java-8-openjdk-amd64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
Leaving ARM environment
Read kivy recipe
Module kivy depend on pygame pyjnius android
Read pygame recipe
Module pygame depend on python sdl
Read pyjnius recipe
Module pyjnius depend on python sdl six
Read android recipe
Module android depend on pygame
Read python recipe
Module python depend on hostpython
Read sdl recipe
Module sdl depend on python
Ignored python, already processed
Ignored sdl, already processed
Read six recipe
Module six depend on python
Ignored pygame, already processed
Read hostpython recipe
Ignored python, already processed
Ignored python, already processed
Modules changed to hostpython python sdl six pygame pyjnius android kivy
Pure-Python modules changed to
Run get packages
Download package for hostpython
Module hostpython already downloaded
Download package for python
Module python already downloaded
Download package for sdl
No package for sdl
Download package for six
Module six already downloaded
Download package for pygame
Module pygame already downloaded
Download package for pyjnius
Module pyjnius already downloaded
Download package for android
No package for android
Download package for kivy
Module kivy already downloaded
Run prebuild
Call prebuild_hostpython
Call prebuild_python
Call prebuild_sdl
Call prebuild_six
Call prebuild_pygame
Call prebuild_pyjnius
Call prebuild_android
Call prebuild_kivy
Run build
Skipped build_hostpython
Skipped build_python
Skipped build_sdl
Call build_six
Entering in ARM environment
Compiler found at /home/metulburr/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin//arm-linux-androideabi-gcc
running install
running build
running build_py
running install_lib
running install_egg_info
Removing /home/metulburr/Downloads/android-zbar-qrcode-master/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/six-1.9.0-py2.7.egg-info
Writing /home/metulburr/Downloads/android-zbar-qrcode-master/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/six-1.9.0-py2.7.egg-info
Leaving ARM environment
Skipped build_pygame
Call build_pyjnius
Entering in ARM environment
Compiler found at /home/metulburr/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin//arm-linux-androideabi-gcc
/home/metulburr/Downloads/android-zbar-qrcode-master/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running build_ext
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
error: Cython does not appear to be installed
/home/metulburr/Downloads/android-zbar-qrcode-master/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running build_ext
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
error: Cython does not appear to be installed
# Command failed: ./distribute.sh -m "kivy" -d "qrcodeexample"
Recommended Tutorials:
Posts: 2,343
Threads: 62
Joined: Sep 2016
That's really bizarre given that you had it working before. Have you installed Cython? Also, did you try the workaround on Github?
Posts: 5,150
Threads: 396
Joined: Sep 2016
Apr-20-2017, 12:17 AM
(This post was last modified: Apr-20-2017, 12:17 AM by metulburr.)
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:
Posts: 5,150
Threads: 396
Joined: Sep 2016
Apr-20-2017, 12:21 AM
(This post was last modified: Apr-20-2017, 12:21 AM by metulburr.)
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:
Posts: 5,150
Threads: 396
Joined: Sep 2016
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:
Posts: 7,137
Threads: 122
Joined: Sep 2016
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.
Posts: 2,343
Threads: 62
Joined: Sep 2016
I'm fairly confident that OCR should be harder than reading a barcode....
Posts: 5,150
Threads: 396
Joined: Sep 2016
probably is, i just cant seem to find any barcode scanners that actually work
Recommended Tutorials:
|