Numpy for Android using kivy

2,178 views
Skip to first unread message

Lorenz Jung

unread,
Oct 6, 2014, 9:23:05 AM10/6/14
to kivy-...@googlegroups.com
Hi all,

I am developing an application for Android using kivy. Since I have to do some audio-processing, I would like to use scipy and numpy.
On my Mac everything works fine, I can use the numpy functions. So I created an apk with buildozer. When I try to open the application with my android device, it crashes. The log file says:

ImportError: No module named numpy

...

Python for android ended.


Is there a possibility to use the numpy and scipy module under android? I think there are some "recipes" (.sh files), but I don't know what exactly to do with them.


I am thankful for any hints.

Regards

Lorenz


Andrei Sima

unread,
Oct 6, 2014, 9:27:36 AM10/6/14
to kivy-...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

______________
random life

Alexander Taylor

unread,
Oct 6, 2014, 11:59:48 AM10/6/14
to kivy-...@googlegroups.com
Just add numpy to your requirements line in buildozer, or as a module in the distribute.sh stage of python-for-android.

Scipy is not supported.

Lorenz Jung

unread,
Oct 6, 2014, 1:05:27 PM10/6/14
to kivy-...@googlegroups.com
Thanks for the hint.
Do I understand it right, I have to modify the buildozer .spec file like that:

# (list) Application requirements
requirements = kivy,numpy

I did that, but when I run bulldozer I get the error:

# Command failed: ./distribute.sh -m "kivy numpy" -d "version"


Lorenz Jung

unread,
Oct 8, 2014, 12:09:47 PM10/8/14
to kivy-...@googlegroups.com
I'm sorry that I have to ask again, but I'm somehow stuck here. Do you have any idea what I'm doing wrong?

Roger Erens

unread,
Oct 8, 2014, 12:36:59 PM10/8/14
to kivy-...@googlegroups.com
Hi Lorenz,

can you show us some more log lines before the error message?
I'm having an issue that involves a nearly identical error message. (and kinda stuck, too).

Roger

Op woensdag 8 oktober 2014 18:09:47 UTC+2 schreef Lorenz Jung:

Lorenz Jung

unread,
Oct 8, 2014, 12:46:18 PM10/8/14
to kivy-...@googlegroups.com
Well, the last message before the error message is:

     #error No long double representation defined

      ^

error: Command "arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /Users/lorenzjung/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -DNDEBUG -DANDROID -mandroid -fomit-frame-pointer --sysroot /Users/lorenzjung/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -Inumpy/core/include -Ibuild/src.macosx-10.4-x86_64-2.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/include -I/Users/lorenzjung/Desktop/number/.buildozer/android/platform/python-for-android/build/python-install/include/python2.7 -Ibuild/src.macosx-10.4-x86_64-2.7/numpy/core/src/multiarray -Ibuild/src.macosx-10.4-x86_64-2.7/numpy/core/src/umath -c build/src.macosx-10.4-x86_64-2.7/numpy/core/src/npymath/npy_math.c -o build/temp.macosx-10.4-x86_64-2.7/build/src.macosx-10.4-x86_64-2.7/numpy/core/src/npymath/npy_math.o" failed with exit status 1


Maybe thats revealing to anyone?

Lorenz Jung

unread,
Oct 10, 2014, 12:20:46 PM10/10/14
to kivy-...@googlegroups.com
Tried it again under Linux, it worked there...thanks guys.

William Hunter Knight

unread,
Jan 8, 2015, 1:40:59 PM1/8/15
to kivy-...@googlegroups.com
Hello, I am having the exact same issue, could you explain what you mean by "Tried it again under Linux"? Does this mean you transferred the entire build process to a Linux machine and started over? Is there any way to complete this process on a Mac?

Lorenz Jung

unread,
Jan 10, 2015, 9:35:13 AM1/10/15
to kivy-...@googlegroups.com
Hi,
yes, I did the build process on a Linux virtual machine. Here you find instruction for setting up the VM:
http://kivy.org/docs/guide/packaging-android-vm.html
I didn't try it on a Mac since then, so I can't help you with that - sorry.
Lorenz

Joel Schnall

unread,
May 10, 2015, 7:04:26 AM5/10/15
to kivy-...@googlegroups.com
Any progress?  I'm still seeing the following on Mac OS:

#error No long double representation defined

romanog_dev

unread,
Jan 25, 2017, 4:28:05 PM1/25/17
to Kivy users support
Hi all,

anybody figured how to fix this on Mac?

Alexander Taylor

unread,
Jan 25, 2017, 6:46:19 PM1/25/17
to kivy-...@googlegroups.com
This issue is very old, and the toolchain has been completely rewritten
since then. numpy should work when built from OS X, if it doesn't then
please start a new email thread giving the full build info and error
log, using the new python-for-android toolchain (if using buildozer, use
`buildozer android_new debug` rather than `buildozer android debug`).
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Kivy users support" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/kivy-users/xHctu5zEd4g/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> kivy-users+...@googlegroups.com
> <mailto:kivy-users+...@googlegroups.com>.
signature.asc
Reply all
Reply to author
Forward
0 new messages