I have small app for Android that is kivy-python based. To turn it into an APK I had to use buildozer.
When I run this final step:
buildozer android debug deploy run I get this error.
I changed the NDK values in the spec files, or I changed codes. In short, what I did was looked at similar errors. I tried reported solutions and they didn't work. I don't even know what the problem is.
Related logs :
[WARNING]: Missing executable: pkg-config is not installed
[WARNING]: Missing executable: libtoolize is not installed
[INFO]: -> running autogen.sh
working: /home/abra/DeskException in thread background thread for pid 3917:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self._target(*self.args, **self._kwargs)
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 1540, in wrap
fn(*args, **kwargs)
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 2459, in background_thread
handle_exit_code(exit_code)
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 2157, in fn
return self.command.handle_command_exit_code(exit_code)
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
ErrorReturnCode_127:
RAN: /home/abra/Desktop/questionapp/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh
STDOUT:
/home/abra/Desktop/questionapp/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh: 2: exec: autoreconf: not found
STDERR:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"_main_", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1189, in <module>
main()
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1183, in main
ToolchainCL()
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 666, in _init_
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 152, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 205, in build_dist_from_args
args, "ignore_setup_py", False
File "pythonforandroid/build.py", line 557, in build_recipes
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/libffi/_init_.py", line 33, in build_arch
shprint(sh.Command('./autogen.sh'), _env=env)
File "pythonforandroid/logger.py", line 178, in shprint
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 863, in next
self.wait()
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 792, in wait
self.handle_command_exit_code(exit_code)
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_127:
RAN: /home/abra/Desktop/questionapp/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh
STDOUT:
/home/abra/Desktop/questionapp/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh: 2: exec: autoreconf: not found
STDERR:
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/abra/Desktop/questionapp/.buildozer/android/platform/build" --ndk-api=21
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
I solved this problem.If someone encounters this error I solved by following these steps
sudo apt update
sudo apt-get install autoconf
pip install --upgrade buildozer
sudo apt install -y git zip unzip openjdk-8-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5
pip3 install --user --upgrade cython virtualenv
Related
i run the command bellow on widows command line
pip install requests
the error that apeared is :
Exception:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python27\lib\site-packages\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python27\lib\site-packages\pip\req.py", line 1265, in prepare_files
req_to_install.extras):
File "C:\Python27\lib\site-packages\pip\_vendor\pkg_resources.py", line 2291, in requires
dm = self._dep_map
File "C:\Python27\lib\site-packages\pip\_vendor\pkg_resources.py", line 2484, in _dep_map
self.__dep_map = self._compute_dependencies()
File "C:\Python27\lib\site-packages\pip\_vendor\pkg_resources.py", line 2508, in _compute_dependencies
parsed = next(parse_requirements(distvers))
File "C:\Python27\lib\site-packages\pip\_vendor\pkg_resources.py", line 45, in <lambda>
next = lambda o: o.next()
File "C:\Python27\lib\site-packages\pip\_vendor\pkg_resources.py", line 2605, in parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
File "C:\Python27\lib\site-packages\pip\_vendor\pkg_resources.py", line 2573, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', 'charset-normalizer ~=2.0.0', 'at', ' ~=2.0.0')
Storing debug log for failure in C:\Users\mchaa\pip\pip.log
ps: i tried to install it from github and the same error every time i don't know how to fix it
solution :
i use the command bellow to uninstall
uninstall current pip:
python -m pip uninstall pip setuptools
download get-pip.py from https://bootstrap.pypa.io/pip/2.7/get-pip.py instead.
after downloding it put it in the same folder that excute the python's command
execute get-pip script:
python get-pip.py
I am running a flask application in Docker. I am also using Pandas. I am using python2.7-alpine image. Earlier it was working fine i.e. I was able to build images with the same configuration.
But now I am unable to build the image as it says:
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-Sm9A7D/pandas/
The command '/bin/sh -c pip install -r /tmp/requirements.txt' returned a non-zero code: 1
I cannot change the python version. As my application is built on python2 and was as expected for a long back.
My Dockerfile
FROM python:2.7-alpine
RUN echo "ipv6" >> /etc/modules;
# echo "http://dl-cdn.alpinelinux.org/alpine/latest-stable/main" > /etc/apk/repositories; \
# echo "http://dl-cdn.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories; \
# echo "http://dl-2.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories; \
# echo "http://dl-3.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories; \
# echo "http://dl-4.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories; \
# echo "http://dl-5.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories
RUN rm -rf /var/cache/apk/* && \
rm -rf /tmp/* && \
apk update && \
apk add --update bash sudo
#================================================================
# add dependencies
#================================================================
RUN apk add --update --no-cache g++ gcc libffi-dev make gpgme p11-kit openssl-dev openssh
#================================================================
# pip and required modules install
#================================================================
### Upgrade pip to prevent errors
RUN pip install setuptools --upgrade
ADD requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
The full error track back is:
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-Sm9A7D/pandas/setup.py", line 749, in <module>
**setuptools_kwargs)
File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 144, in setup
_install_setup_requires(attrs)
File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 717, in fetch_build_eggs
replace_conflicting=True,
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
replace_conflicting=replace_conflicting
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
return self.obtain(req, installer)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
return installer(requirement)
File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 784, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 679, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 705, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 890, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1158, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1144, in run_setup
run_setup(setup_script, args)
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
raise
File "/usr/local/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/local/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-2BV0tR/numpy-1.17.0rc1/setup.py", line 31, in <module>
def is_platform_mac():
RuntimeError: Python version >= 3.5 required.
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-Sm9A7D/pandas/
The command '/bin/sh -c pip install -r /tmp/requirements.txt' returned a non-zero code: 1
The error tells you the reason:
File "/tmp/easy_install-r9No9Q/numpy-1.17.0rc1/setup.py", line 31, in
def is_platform_mac():
RuntimeError: Python version >= 3.5 required.
From pandas 0.23.4 source: we can see the minimum version for numpy is 1.9.0:
min_numpy_ver = '1.9.0'
So, if you did not install a version by yourself, pandas will just install a newest suitable version of numpy which >1.9.0 for you, here is numpy-1.17.0rc1, but it needs >python3.5 as seen here, so failure happens.
python_requires='>=3.5'
Finally, if you check the source code of numpy, you will find 1.16.4 is the last version which support python2.7, see this,
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
So, final solution:
Pre-install numpy 1.16.4, then pandas find there is a suitable numpy there, and will not install a newest numpy for you. As a result, no error will happen, detail steps as next:
apk update
apk add build-base
pip install numpy==1.16.4
pip install pandas==0.23.4
For Dockerfile, add above command to one RUN could make the fix:
RUN apk update && \
apk add build-base && \
pip install numpy==1.16.4 && \
pip install pandas==0.23.4
Additional, you said in question:
Earlier it was working fine i.e. I was able to build images with the same configuration.
This is because numpy latest version was just updated July.1st 2019, before that, it always 1.16.4 version which don't have issue for python27, but now, things changed...
I try to get started with Lektor CMS internals and would like to run it under the great Pycharm debugger. In particular I want to run
$ lektor server
I followed the steps
$ git clone https://github.com/lektor/lektor
$ cd lektor
$ virtualenv venv
$ . venv/bin/activate
$ pip install --editable .
$ make build-js
$ make install-git-hooks
$ export LEKTOR_DEV=1
$ lektor quickstart --path example-project
$ lektor --project example-project server
in the Github readme about development and they work just fine in the terminal. Then I created the following Pycharm debug-config:
However this throws the following RuntimeException:
Traceback (most recent call last):
File "/home/barrios/IDEs/pycharm-community-2018.1.1/helpers/pydev/pydevd.py", line 1664, in <module>
main()
File "/home/barrios/IDEs/pycharm-community-2018.1.1/helpers/pydev/pydevd.py", line 1658, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/home/barrios/IDEs/pycharm-community-2018.1.1/helpers/pydev/pydevd.py", line 1085, in run
runpy._run_module_as_main(module_name, alter_argv=False)
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/barrios/code/lektor/lektor/__main__.py", line 3, in <module>
main(as_module=True)
File "/home/barrios/code/lektor/lektor/cli.py", line 627, in main
cli.main(args=args, prog_name=name)
File "/home/barrios/code/lektor/venv/local/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/barrios/code/lektor/venv/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/barrios/code/lektor/venv/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/barrios/code/lektor/venv/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/barrios/code/lektor/venv/local/lib/python2.7/site-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/home/barrios/code/lektor/venv/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/barrios/code/lektor/lektor/cli.py", line 387, in server_cmd
browse=browse)
File "/home/barrios/code/lektor/lektor/devserver.py", line 124, in run_server
dt.start()
File "/home/barrios/code/lektor/lektor/devserver.py", line 75, in start
portable_popen(['npm', 'install', '.'], cwd=admin).wait()
File "/home/barrios/code/lektor/lektor/utils.py", line 486, in portable_popen
raise RuntimeError('Could not locate executable "%s"' % cmd[0])
RuntimeError: Could not locate executable "npm"
Process finished with exit code 1
Obviously it can't find npm to init the Web-UI. When replacing the parameter 'server' with 'build', debugging works fine. Is it impossible to run this Javascript code via subprocess from inside Pycharm debugger?
Or what else am I doing wrong? Any ideas how to fix this? TNX in advance.
EDIT: I read in some other SO-thread Pycharm is probably running a subprocess under the system Python interpreter outside the virtualenv?!? This would explain why it messes up dependencies, but the npm command IS available anywhere on the system... So why is it not found???
I'm trying to start a Pinax Project for Django.
I setup my Python Virtual Environment.
Upgraded setup tools.
Upgraded pip.
Installed Pinax.
Then when I tried 'pinax start blog my_site', it gave the following error:
Installing Django...
Traceback (most recent call last):
File "/usr/local/bin/pinax", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 700, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 680, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/decorators.py", line 63, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pcli.py", line 97, in start
pip_install("Django")
File "/usr/local/lib/python2.7/dist-packages/pcli.py", line 23, in pip_install
command.run(opts, [package])
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 439, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 707, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Jr1szu/Django/
I've tried making a python virtual environment inside my conda environment. Also tried making a standalone python environment. Neither solved it. Also tried installing django using pip.
Gave the following error:
sudo pip install django
The directory '/home/scarlet/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/scarlet/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting django
Downloading Django-2.0.tar.gz (8.0MB)
100% |████████████████████████████████| 8.0MB 62kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-SNP9W5/django/setup.py", line 32, in <module>
version = __import__('django').get_version()
File "django/__init__.py", line 1, in <module>
from django.utils.version import get_version
File "django/utils/version.py", line 61, in <module>
#functools.lru_cache()
AttributeError: 'module' object has no attribute 'lru_cache'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-SNP9W5/django/
What would you suggest?
Thank you for the read!
It appears like you are using python 2; if that is correct Django version 2 only supports python 3. Please refer to https://docs.djangoproject.com/en/2.0/releases/2.0/#python-compatibility
You could try installing a lower version of Django:
pip install "Django<2"
you may try:
pip3 install django
I am trying to deploy python flask application using apache2 and mod-wsgi.
I am following this link.
While installing mog-wsgi using the command sudo apt-get install libapache2-mod-wsgi ,I see these lines at the end
apache2_invoke: Enable module wsgi
Action 'configtest' failed.
The Apache error log may have more information.
apache2_reload: Your configuration is broken. Not restarting Apache 2
Is this a smooth installation?
Also, in step 1 of the link when I tried to create a virtual environment using the command
sudo virtualenv venv
This gives me error sudo: virtualenv: command not found
So, I tried to install virtualenv using sudo pip install virtualenv, I am getting this huge error in red(exception).
Downloading/unpacking virtualenv
Downloading virtualenv-15.0.1-py2.py3-none-any.whl (1.8MB): 733kB downloaded
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1198, in prepare_files
do_download,
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1376, in unpack_url
self.session,
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 572, in unpack_http_url
download_hash = _download_url(resp, link, temp_location)
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 433, in _download_url
for chunk in resp_read(4096):
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 421, in resp_read
chunk_size, decode_content=False):
File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/response.py", line 225, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/response.py", line 174, in read
data = self._fp.read(amt)
File "/usr/lib/python2.7/httplib.py", line 573, in read
s = self.fp.read(amt)
File "/usr/lib/python2.7/socket.py", line 380, in read
data = self._sock.recv(left)
File "/usr/lib/python2.7/ssl.py", line 341, in recv
return self.read(buflen)
File "/usr/lib/python2.7/ssl.py", line 260, in read
return self._sslobj.read(len)
SSLError: The read operation timed out
Storing debug log for failure in /home/myname/.pip/pip.log
What could be the problem?
Please use apt-get install virtualenv or apt-get install python-virtualenv (depending on your OS version) instead of polluting the system with packages installed by sudo pip install.