Build Error while converting python file into apk using buildozer - python-2.7

I have made a simple app in python using Kivy and now I want this to be converted into an apk file so that I can use it in my android mobile.
But constantly I am getting following build error while converting it. I am using buildozer for building an apk file.
I have checked for any missing files or directory, but that's not the case. OS : UBUNTU 12.04. The Error is :
[aapt] ~/.buildozer/android/platform/android-sdk-21/platform-tools/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
BUILD FAILED
~/.buildozer/android/platform/android-sdk-21/tools/ant/build.xml:645: The following error occurred while executing this line:
~/.buildozer/android/platform/android-sdk-21/tools/ant/build.xml:683: null returned: 127
Total time: 1 second
.
.
.
assets/private.mp3: /home/manish/kivy/.buildozer/android/app/sitecustomize.pyo
Traceback (most recent call last):
File "build.py", line 412, in <module>
make_package(args)
File "build.py", line 336, in make_package
subprocess.check_call([ANT, arg])
File "/usr/lib/python2.7/subprocess.py", line 511, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1
# Command failed: /usr/bin/python2.7 build.py --name 'My Application' --version 1.0 --package org.test.myapp --private /home/manish/kivy/.buildozer/android/app --sdk 14 --minsdk 8 --orientation landscape --window debug

We need to install ia32libs. use " sudo apt-get install ia32-libs " command on ubuntu. I got this question's answer on IRC channel of kivy and it worked for me. Initially i have not installed it as it is for 32-bit system. They said that android tools still require us to download and install ia32-libs on 64bit systems.

This is a fairly generic error that could cover a few different things. Could you paste the full log from buildozer (including with the --verbose option, or log_level = 2 in your buildozer.spec.
You can also do some basic troubleshooting, like check you have the build dependencies installed. I'm not sure which ones could cause this, maybe make sure you have javac (via openjdk probably).

Zlib development package is installed?
You can try:
sudo apt-get install zlib1g-dev
Or some missing packages.

Related

Installation of tflite c++ on ubuntu 20.04

I want to install tflite c++ on my ubuntu 20.04 but I am having some issues regarding installation. I got to know that I can only build this by using cmake or bazel but unfortunately both of them were not working for me. As cmake taking alot of RAM so it gets crash every time when it reaches to 96% during build and bazel is also giving some error during build. After using this command.
bazel build -c opt //tensorflow/lite:libtensorflowlite.so
It gave me this
error. I have also checked that numpy is available.
I was following this video.
Can anyone please send me the link of github where tflite c++ is available for ubuntu or any other link from where i can install this easily. As I am new in this. Your comments and suggestions will be greatly appreciated.
Thanks in advance.
Here is the error which I am getting.
bazel build -c opt //tensorflow/lite:libtensorflowlite.so
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=91
INFO: Reading rc options for 'build' from /home/umer/Downloads/tensorflow-2.4.2/.bazelrc:
Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /home/umer/Downloads/tensorflow-2.4.2/.bazelrc:
'build' options: --apple_platform_type=macos --define framework_shared_object=true --define open_source_build=true --java_toolchain=//third_party/toolchains/java:tf_java_toolchain --host_java_toolchain=//third_party/toolchains/java:tf_java_toolchain --define=tensorflow_enable_mlir_generated_gpu_kernels=0 --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --noincompatible_prohibit_aapt1 --enable_platform_specific_config --config=short_logs --config=v2
INFO: Reading rc options for 'build' from /home/umer/Downloads/tensorflow-2.4.2/.tf_configure.bazelrc:
'build' options: --host_force_python=PY2 --action_env PYTHON_BIN_PATH=/usr/bin/python --action_env PYTHON_LIB_PATH=/usr/local/lib/python2.7/dist-packages --python_path=/usr/bin/python --config=xla --action_env TF_CONFIGURE_IOS=0
INFO: Found applicable config definition build:short_logs in file /home/umer/Downloads/tensorflow-2.4.2/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /home/umer/Downloads/tensorflow-2.4.2/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:xla in file /home/umer/Downloads/tensorflow-2.4.2/.bazelrc: --define=with_xla_support=true
INFO: Found applicable config definition build:linux in file /home/umer/Downloads/tensorflow-2.4.2/.bazelrc: --copt=-w --host_copt=-w --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 --config=dynamic_kernels
INFO: Found applicable config definition build:dynamic_kernels in file /home/umer/Downloads/tensorflow-2.4.2/.bazelrc: --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS
DEBUG: Rule 'io_bazel_rules_go' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1557349968 -0400"
DEBUG: Repository io_bazel_rules_go instantiated at:
no stack (--record_rule_instantiation_callstack not enabled)
Repository rule git_repository defined at:
/home/umer/.cache/bazel/_bazel_umer/ed358c98f40a3a8df15c688cf3579422/external/bazel_tools/tools/build_defs/repo/git.bzl:195:18: in <toplevel>
INFO: Repository local_config_python instantiated at:
no stack (--record_rule_instantiation_callstack not enabled)
Repository rule python_configure defined at:
/home/umer/Downloads/tensorflow-2.4.2/third_party/py/python_configure.bzl:294:20: in <toplevel>
ERROR: An error occurred during the fetch of repository 'local_config_python':
Traceback (most recent call last):
File "/home/umer/Downloads/tensorflow-2.4.2/third_party/py/python_configure.bzl", line 267
_create_local_python_repository(<1 more arguments>)
File "/home/umer/Downloads/tensorflow-2.4.2/third_party/py/python_configure.bzl", line 213, in _create_local_python_repository
_get_numpy_include(<2 more arguments>)
File "/home/umer/Downloads/tensorflow-2.4.2/third_party/py/python_configure.bzl", line 187, in _get_numpy_include
execute(repository_ctx, <3 more arguments>)
File "/home/umer/Downloads/tensorflow-2.4.2/third_party/remote_config/common.bzl", line 217, in execute
fail(<1 more arguments>)
Problem getting numpy include path.
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named numpy
Is numpy installed?
ERROR: Analysis of target '//tensorflow/lite:libtensorflowlite.so' failed; build aborted: Traceback (most recent call last):
File "/home/umer/Downloads/tensorflow-2.4.2/third_party/py/python_configure.bzl", line 267
_create_local_python_repository(<1 more arguments>)
File "/home/umer/Downloads/tensorflow-2.4.2/third_party/py/python_configure.bzl", line 213, in _create_local_python_repository
_get_numpy_include(<2 more arguments>)
File "/home/umer/Downloads/tensorflow-2.4.2/third_party/py/python_configure.bzl", line 187, in _get_numpy_include
execute(repository_ctx, <3 more arguments>)
File "/home/umer/Downloads/tensorflow-2.4.2/third_party/remote_config/common.bzl", line 217, in execute
fail(<1 more arguments>)
Problem getting numpy include path.
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named numpy
Is numpy installed?
INFO: Elapsed time: 87.176s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (11 packages loaded, 19 targets configured)
currently loading: #bazel_tools//tools/jdk
Fetching #local_execution_config_python; Restarting.
Fetching #rules_java; fetching
Fetching #io_bazel_rules_docker; fetching
Fetching #go_sdk; fetching
I could successfully install tflite c++ on ubuntu 20.04. I have used the following commands in a conda virtual environment. As per the tested build configurations TF v2.4 is compatible with Bazel 3.1.0. Hence I have used Bazel 3.1.0 to install tflite c++.
sudo apt update
sudo apt upgrade
#install python
sudo apt-get install python
#set environment variable "/usr/bin/python" in my case
export PATH=$PATH:/path/to/python
#Install the TensorFlow pip package dependencies
pip install -U --user pip numpy wheel packaging requests opt_einsum
pip install -U --user keras_preprocessing --no-deps
#Install Bazel and move file to bin folder so that it will be available system wide
chmod +x bazel-3.1.0-linux-x86_64
sudo mv bazel-3.1.0-linux-x86_64 ./.local/bin/bazel
cd ./.local/bin
#Extract bazel installation
bazel
#Check bazel version
bazel --version
#clone tensorflow repo in the same location where Anaconda is installed
cd ~
#clone tensorflow repo
git clone https://github.com/tensorflow/tensorflow.git
#Download the source code of tensorflow 2.4.2 and unzip it
cd tensorflow-2.4.2
python ./configure.py
It prompts the following:
Please specify the location of python. [Default is /usr/bin/python3]:
You can press Enter if the default location is ok.
Do you wish to build TensorFlow with ROCm support? [y/N]: N No ROCm
support will be enabled for TensorFlow.
Do you wish to build TensorFlow with CUDA support? [y/N]: N No CUDA
support will be enabled for TensorFlow.
Do you wish to download a fresh release of clang? (Experimental)
[y/N]: N Clang will not be downloaded.
Please specify optimization flags to use during compilation when bazel
option "--config=opt" is specified [Default is -Wno-sign-compare]:
Would you like to interactively configure ./WORKSPACE for Android
builds? [y/N]: N Not configuring the WORKSPACE for Android builds.
I have opted "N" for all the prompts
#bazel command to build build tflite library
bazel build -c opt //tensorflow/lite:libtensorflowlite.so
You can see the Build successful screenshot below. Thank you!

ERROR: command "pkg-config --modversion libgphoto2" failed

I am getting an error when I try to install Gphoto2 on my windows pc.
I have tried installing following the instructions from https://pypi.org/project/gphoto2/ and downloading the zip from git clone https://github.com/jim-easterbrook/python-gphoto2.git but have had no success.
This module is supposed to install successfully.
Using the PYPI https://pypi.org/project/gphoto2/
I have tried to follow and install this module also downloading and installing the zip from:
git clone https://github.com/jim-easterbrook/python-gphoto2.git
I have had great difficulty, any advice or suggestion would be greatly appreciated.
C:\Users\Sam\Downloads\python-gphoto2-master\python-gphoto2-master> python setup.py install
ERROR: command "pkg-config --modversion libgphoto2" failed
This module Gphoto2 is supposed to install successfully.
This is what the complete error says:
C:\Users\Sam\Downloads\python-gphoto2-master\python-gphoto2-master>
python setup.py install ERROR: command "pkg-config --modversion
libgphoto2" failed Traceback (most recent call last): File "setup.py",
line 36, in <module> cmd, stderr=FNULL,
universal_newlines=True).split('.') File
"C:\python27\lib\subprocess.py", line 212, in check_output process =
Popen(stdout=PIPE, *popenargs, **kwargs) Windows: [Error 2] The system cannot find the file specified
I'm the author of python-gphoto2.
Python-gphoto2 is not expected to work on Windows. The PyPI page (https://pypi.org/project/gphoto2/) shows the supported operating systems - MacOS and POSIX compatible (e.g. Linux).
I have been able to install it in MSYS2 (http://www.msys2.org/) but it isn't useful unless you get Windows to use libusb instead of its normal driver for your camera.

PyMC installation error with pip

I am attempting to install PyMC using pip install pymc. I believe this command should install PyMC 2.3.6.
PyMC has a few dependencies, which I have in my PATH. I am running OSX 10.11.2 and my PATH includes Python 2.7.13, NumPy 1.12.0, Matplotlib 2.0.0, gcc, and gfortran.
Python (including pip) was installed using Homebrew. NumPy and Matplotlib were installed using pip. The gfortran compiler was downloaded and installed from the GCC Wiki for the purpose of this installation.
Executing pip install pymc yielded lots of output including the following lines.
Collecting pymc
Using cached pymc-2.3.6.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
running build_src
build_src
building extension "pymc.flib" sources
f2py options: ['skip:ppnd7']
f2py:> build/src.macosx-10.11-x86_64-2.7/pymc/flibmodule.c
creating build
creating build/src.macosx-10.11-x86_64-2.7
creating build/src.macosx-10.11-x86_64-2.7/pymc
IOError: [Errno 2] No such file or directory: 'skip:ppnd7'. Skipping file "skip:ppnd7".
updatevars:gradlike: attempt to change 'dimension(nx)' to 'dimension(na)'. Ignoring.
updatevars:gradlike: attempt to change 'dimension(nx)' to 'dimension(nb)'. Ignoring.
updatevars:gradlike: attempt to change 'dimension (nmu)' to 'dimension(nmu)'. Ignoring.
updatevars:gradlike: attempt to change 'dimension (na)' to 'dimension(na)'. Ignoring.
rmbadname1: Replacing "index" with "index_bn".
Reading fortran codes...
Reading file 'pymc/flib.f' (format:fix,strict)
Line #34 in pymc/flib.f:" PARAMETER (infinity = 1.7976931348623157d308)"
get_parameters: got "unexpected EOF while parsing (<string>, line 0)" on ''
...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/2f/cr97n5v93mn04c3qbqd7r3q40000gn/T/pip-build-6Zmgcz/pymc/setup.py", line 124, in <module>
**(config_dict))
File "/usr/local/lib/python2.7/site-packages/numpy/distutils/core.py", line 169, in setup
return old_setup(**new_attr)
...
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/2f/cr97n5v93mn04c3qbqd7r3q40000gn/T/pip-build-6Zmgcz/pymc/
As suggested in these two pip installation threads about egg_info errors [1, 2], I ran pip install —upgrade setuptools and pip install ez_setup. Once these items were installed I ran into the same types of errors pasted above.
As noted in other package installation threads, I am willing to use conda to install PyMC if I cannot resolve these issues. However, I'd like to investigate this installation issue first.
Would anyone happen to know what my issue is here? Might there be some steps I can take to successfully install PyMC using pip?
I had the same problem. I don't understand the root cause, but I fixed it by downgrading numpy to version 1.10.1: pip install numpy==1.10.1
I also met this problem while trying to install pymc from pip or source code, but I found a solution that might be useful.
The reason that causes the problem might be the file setup.py, in which the script check the compile env. I didn't read the code very carefully, but in the function build_ext() I think the codes first check whether some compile environments have already been installed into OS. If installed, the script will use them as defaults; if not, use ones in somewhere else (the comment says 'from netlib sources').
I infer the problem is caused by the compile environments that have already been installed in the OS, so I modify the file setup.py to skip this part of codes, and let the script use the netlib source. Then I run sudo python setup.py install. There are some error and warning messages, but the folder 'pymc' emerges in python library, and some simple test codes run successfully.

How to install and run the reindent.py

I have downloaded the Reindent-0.1.0 and trying to use this for automated indention purpose.
I don't know how to install and run these commands and while I am trying to use this command
I am getting following error
command:
C:\Python26\Scripts\Reindent-0.1.0>Python setup.py
C:\Python26\Scripts\Reindent-0.1.0>Pyth
Traceback (most recent call last):
File "setup.py", line 5, in <module>
from setuptools import setup
ImportError: No module named setuptools
I don't understand the setuptools, where it is and how to put inside
please note my folder files in Reindent-0.1.0
Reindent.egg-info
PKG-INFO
README
reindent
setup.cfg
setup.py
Also how can I run the commands for reindent, for an example, once after I installed the reindent, if I want to
run dryrun command how I should write?
If I write like this, will it be correct ???
C:\ProjFolder\ApplicationDevelopment\GUI>reindent -d Test.py
some realtime example of "-d (--dryrun) Dry run and -r (--recurse) Recurse" will be helpful!!
and where I should target the command file path, in dos
to my application running directory or C:\Python26\Scripts\Reindent-0.1.0 ?? OR Application development folder??
If you get the error "no module X" when you try to run some code, that code has a dependency on module X. When you run setup.py and it says there is no module named "setuptools", it is telling you that setup.py requires the module "setuptools". Since you don't have "setuptools" installed on your machine, you get the error.
The fix is simple: install the setuptools module. Here's one of several places on the internet that shows you how to install setuptools: https://pythonhosted.org/an_example_pypi_project/setuptools.html

Need help installing Biopython

Have mac OS 10.6 and have python verion 2.7 32 bit intalled as
well as numpy and scipy.
also have xcode version 3.2, Im really confused as to what to do at this point. I download
biopython version 1.59 and tried to run the setup code in python but it wont work. what am i missing?
when i try and run the setup file in idle i get this error message:
Traceback (most recent call last):
File "/Users/Cliff/Downloads/biopython-1.58/setup.py", line 379, in <module>
'Bio.PopGen': ['SimCoal/data/*.par'],
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 140, in setup
raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: no commands supplied
You need to run python setup.py install from Terminal.app. You should be in a bash, tcsh, etc. shell, not in a Python shell.
Just as an probably easier alternative:
Biopython is also available via pip:
pip install biopython
Or (even better) via bioconda (try it out, it's great):
conda install biopython
For this just install miniconda (very easy and does NOT require admin rights) from here. and then add the bioconda channel as per these simple instructions.
Strangly these two simple options are missing in the biopython tutorial
The error shows that you did not supply a command to the install script. The usual command is 'install', so try:
python setup.py install
In any event, as the error suggests, you can use:
python setup.py --help