Command failed: python -m pythonforandroid.toolchain create

3,011 views
Skip to first unread message

Frank Gould

unread,
Sep 18, 2016, 2:30:29 PM9/18/16
to Kivy users support
I have been pounding on this buidozer problem for days now and cannot find or figure out how to successfully build my kivy app.  My command to build is:  '

buildozer android_new debug deploy run' and it generates the following error:


[INFO]:    -> running gcc -dumpmachine

('path is', '/Users/fgould/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86/bin/:/Users/fgould/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/:/Users/fgould/.buildozer/android/platform/android-ndk-r9c:/Users/fgould/.buildozer/android/platform/android-sdk-21/tools:/Users/fgould/.buildozer/android/platform/apache-ant-1.9.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/apache-ant/bin:/Users/fgould/.buildozer/android/platform/android-sdk-21:/Users/fgould/.buildozer/android/platform/android-sdk-21/tools:/Users/fgould/.buildozer/android/platform/android-sdk-21/platform-tools')

[INFO]:    -> running cp /Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/recipes/python2/Setup.loca...(and 25 more)           

[INFO]:    -> running sed -i s#^SSL=.*#SSL=/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a/openss...(and 22 more)

Traceback (most recent call last):                                                                                                                                                   

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main

    "__main__", fname, loader, pkg_name)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code

    exec code in run_globals

  File "/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 798, in <module>

    main()

  File "/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 795, in main

    ToolchainCL()

  File "/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 470, in __init__

    getattr(self, args.subparser_name.replace('-', '_'))(args)

  File "/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 146, in wrapper_func

    build_dist_from_args(ctx, dist, args)

  File "/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 189, in build_dist_from_args

    build_recipes(build_order, python_modules, ctx)

  File "pythonforandroid/build.py", line 561, in build_recipes

  File "/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/recipes/python2/__init__.py", line 44, in build_arch

    self.do_python_build(arch)

  File "/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/recipes/python2/__init__.py", line 100, in do_python_build

    shprint(sh.sed, '-i', 's#^SSL=.*#SSL={}#'.format(openssl_build_dir), setuplocal)

  File "pythonforandroid/logger.py", line 173, in shprint

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sh.py", line 565, in next

    self.wait()

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sh.py", line 500, in wait

    self.handle_command_exit_code(exit_code)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sh.py", line 516, in handle_command_exit_code

    raise exc(self.ran, self.process.stdout, self.process.stderr)

sh.ErrorReturnCode_1: 


  RAN: '/usr/bin/sed -i s#^SSL=.*#SSL=/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a/openssl# Modules/Setup.local'


  STDOUT:

sed: 1: "Modules/Setup.local": invalid command code M


  STDERR:


# Command failed: python -m pythonforandroid.toolchain create --dist_name=slideshow --bootstrap=sdl2 --requirements=kivy,openssl,pyopenssl --arch armeabi-v7a --copy-libs --local-recipes /Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/python-for-android/recipes --color=always --storage-dir=/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/build

# 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 have log_level = 2 to generate the above and truncated just before the error occurred.  I don't see anything but warnings above this error message.  I've searched online and could not find a solution.  All help appreciated.

Alexander Taylor

unread,
Sep 18, 2016, 4:44:20 PM9/18/16
to Kivy users support
I think there might be a problem with a recent-ish SSL patch, although I don't think I've seen this exact result before. I'll take a look at it sometime soonish if possible.

Frank Gould

unread,
Sep 20, 2016, 8:34:56 AM9/20/16
to Kivy users support
Hello Alexander, THANKS for your response. Anything you can do to help will be greatly appreciated. I have tried all I can find to solve this compile issue including rebuilding my dev environment. Please let me know if there is anything I can do to help solve this. I am dead in the water with my apk now. ;-(

Frank Gould

unread,
Sep 25, 2016, 3:48:17 PM9/25/16
to Kivy users support
My 7 year old Rottweiler died this morning and now I'm wondering if my Kivy app is dead too.  Is there anyone who can help me resolve this compile error?  Please let me know.

NumesSanguis

unread,
Sep 26, 2016, 11:41:09 AM9/26/16
to Kivy users support

Frank Gould

unread,
Oct 1, 2016, 11:53:04 AM10/1/16
to Kivy users support
Thanks for the suggestion.  I appreciate any suggestions or where I might have missed something.  I updated buildozer.spec with

p4a.local_recipes = %(source.dir)s/.buildozer/android/platform/python-for-android/recipes


1. After the app compiles with 'buildozer android debug...', installs, and runs, it crashes with the following error:

E/dalvikvm( 2326): dlopen("/data/app-lib/com.masterpics.slideshow-1/libpython2.7.so") failed: dlopen failed: cannot locate symbol "pow" referenced by "libpython2.7.so"...


2. During the app compile with 'buildozer android_new debug...', the compile script crashes with the following error:

[INFO]:    -> running sed -i s#^SSL=.*#SSL=/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a/openssl# Modules/Setup.local

Frank Gould

unread,
Oct 5, 2016, 10:25:52 AM10/5/16
to Kivy users support
I deleted .buildozer and tried the compile. Below is the results I got:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 807, in <module>
    main()
  File "/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 804, in main
    ToolchainCL()
  File "/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 479, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 146, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 189, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "pythonforandroid/build.py", line 540, in build_recipes
  File "pythonforandroid/recipe.py", line 342, in download_if_necessary
  File "pythonforandroid/recipe.py", line 381, in download
  File "pythonforandroid/recipe.py", line 148, in download_file
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 273, in retrieve
    block = fp.read(bs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 380, in read
    data = self._sock.recv(left)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 714, in recv
    return self.read(buflen)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 608, in read
    v = self._sslobj.read(len or 1024)
socket.error: [Errno 54] Connection reset by peer
# Command failed: python -m pythonforandroid.toolchain create --dist_name=slideshow --bootstrap=sdl2 --requirements=kivy,openssl,pyopenssl --arch armeabi-v7a --copy-libs --local-recipes /Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/python-for-android/recipes --color=always --storage-dir=/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/build
# 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

Frank Gould

unread,
Oct 6, 2016, 11:07:49 AM10/6/16
to Kivy users support
I searched my buildozer log for toolchain and found "[WARNING]: Missing executable: libtoolize is not installed." Searched for a solution to that and found: 

Building python2 for armeabi fails due to space character in storage_dir (OS X) #622

I am not sure how to fix this problem and if it will solve the problem I originally reported.

Frank Gould

unread,
Oct 6, 2016, 1:29:29 PM10/6/16
to Kivy users support
Hello Alexander, I am still trying to get my compile to work but get the same toolchain create error. I've tried several times to delete my .buildozer folder in both the app and home folders in hopes to fix this warning:  Missing executable: libtoolize is not installed. I found in __init__.py where it is checking for the module installed but don't know what to do to install libtoolize.  Any suggestions would be greatly appreciated. Thanks. 

Joey daniel darko

unread,
Oct 6, 2016, 3:25:04 PM10/6/16
to Kivy users support

sudo apt-get install build-essential libtool
try this,

Frank Gould

unread,
Oct 7, 2016, 9:10:22 AM10/7/16
to Kivy users support
Thanks Joey! The install suggestion turned out to be the following for my mac:

curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz
tar -xzf libtool-2.4.2.tar.gz
cd libtool-2.4.2
./configure && make && sudo make install

Frank Gould

unread,
Oct 7, 2016, 11:00:26 AM10/7/16
to Kivy users support
I successfully installed the libtool module and the warning is not displaying. I still get the same results 'Command failed: python -m pythonforandroid.toolchain create' when I run buildozer, as listed below. I tried commenting out the '__init__.py", line 100, in do_python_build' but ended up with the same 'Command failed' results. Any other ideas? I've searched everywhere I can for a solution but am not making progress. Any help greatly appreciated.


On Sunday, September 18, 2016 at 2:30:29 PM UTC-4, Frank Gould wrote:

Michael OBrien

unread,
Nov 29, 2016, 8:22:03 PM11/29/16
to Kivy users support

Derek

unread,
Sep 6, 2017, 6:06:29 PM9/6/17
to Kivy users support
Did this ever get fixed? Was it caused my kivy gardens?
Reply all
Reply to author
Forward
0 new messages