Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: The _imaging C module is not installed #352

Closed
tanayz opened this issue May 18, 2016 · 2 comments
Closed

ImportError: The _imaging C module is not installed #352

tanayz opened this issue May 18, 2016 · 2 comments

Comments

@tanayz
Copy link

tanayz commented May 18, 2016

My kivy app chooses a jpg file from disk and converts that into a smaller tiff file for faster processing.
Below are the line of codes

 img = Image.open(fname)    
        blurred = img.filter(ImageFilter.BLUR)
        ba = np.array(blurred)

This code along with the whole program works fine in my ubuntu desktop but crashes in android when the program tries to chose an image file with below error,although I've added the supported pil python library in buildozer.spec requirements section.

I/python ( 4328): Initialize Python for Android
I/python ( 4328): Changing directory to the one provided by ANDROID_ARGUMENT
I/python ( 4328): /data/data/org.test.fstest/files
I/python ( 4328): Preparing to initialize python
I/python ( 4328): crystax_python does not exist
I/python ( 4328): Initialized python
I/python ( 4328): AND: Init threads
V/SDL ( 4328): onWindowFocusChanged(): true
I/python ( 4328): testing python print redirection
I/python ( 4328): Setting up python from ANDROID_PRIVATE
I/ActivityManager( 479): Displayed org.test.fstest/org.kivy.android.PythonActivity: +698ms
I/Keyboard.Facilitator( 719): onFinishInput()
I/python ( 4328): ('Android path', ['/data/data/org.test.fstest/files/lib/python27.zip', '/data/data/org.test.fstest/files/lib/python2.7/', '/data/data/org.test.fstest/files/lib/python2.7/lib-dynload/', '/data/data/org.test.fstest/files/lib/python2.7/site-packages/', '/data/data/org.test.fstest/files'])
I/python ( 4328): ('os.environ is', {'ANDROID_APP_PATH': '/data/data/org.test.fstest/files', 'EXTERNAL_STORAGE': '/storage/emulated/legacy', 'LOOP_MOUNTPOINT': '/mnt/obb', 'ANDROID_SOCKET_zygote': '10', 'BOOTCLASSPATH': '/system/framework/core.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/webviewchromium.jar', 'ANDROID_PROPERTY_WORKSPACE': '9,0', 'PATH': '/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin', 'ANDROID_STORAGE': '/storage', 'ANDROID_BOOTLOGO': '1', 'EMULATED_STORAGE_TARGET': '/storage/emulated', 'ANDROID_ASSETS': '/system/app', 'LD_LIBRARY_PATH': '/vendor/lib:/system/lib', 'ANDROID_PRIVATE': '/data/data/org.test.fstest/files', 'ANDROID_ENTRYPOINT': 'main.pyo', 'PYTHONPATH': '/data/data/org.test.fstest/files:/data/data/org.test.fstest/files/lib', 'ANDROID_DATA': '/data', 'EMULATED_STORAGE_SOURCE': '/mnt/shell/emulated', 'PYTHON_NAME': 'python', 'ANDROID_ROOT': '/system', 'PYTHONHOME': '/data/data/org.test.fstest/files', 'ASEC_MOUNTPOINT': '/mnt/asec', 'ANDROID_ARGUMENT': '/data/data/org.test.fstest/files'})
I/python ( 4328): ('Android kivy bootstrap done. name is', 'main')
I/python ( 4328): ['/data/data/org.test.fstest/files/lib/python2.7/site-packages', '/data/data/org.test.fstest/files/lib/site-python']
I/python ( 4328): AND: Ran string
I/python ( 4328): Run user program, change dir and execute entrypoint
I/python ( 4328): main.py
I/python ( 4328): [INFO ] [Logger ] Record log in /data/data/org.test.fstest/files/.kivy/logs/kivy_16-05-17_2.txt
I/python ( 4328): [INFO ] [Kivy ] v1.9.2-dev0
I/python ( 4328): [INFO ] [Python ] v2.7.2 (default, May 16 2016, 04:19:22)
I/python ( 4328): [GCC 4.8]
I/python ( 4328): [INFO ] [Factory ] 193 symbols loaded
I/python ( 4328): [INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)
I/python ( 4328): [INFO ] [OSC ] using for socket
I/python ( 4328): [ERROR ] [Input ] AndroidJoystick is not supported by your version of linux
I/python ( 4328): Traceback (most recent call last):
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/input/providers/init.py", line 57, in
I/python ( 4328): import kivy.input.providers.androidjoystick
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/input/providers/androidjoystick.py", line 20, in
I/python ( 4328): raise Exception('android lib not found.')
I/python ( 4328): Exception: android lib not found.
I/python ( 4328): [INFO ] [Window ] Provider: sdl2
I/python ( 4328): [INFO ] [GL ] OpenGL version <OpenGL ES 2.0 14.01003>
I/python ( 4328): [INFO ] [GL ] OpenGL vendor
I/python ( 4328): [INFO ] [GL ] OpenGL renderer <NVIDIA Tegra 3>
I/python ( 4328): [INFO ] [GL ] OpenGL parsed version: 2, 0
I/python ( 4328): [INFO ] [GL ] Texture max size <2048>
I/python ( 4328): [INFO ] [GL ] Texture max units <16>
I/python ( 4328): [INFO ] [Window ] auto add sdl2 input provider
I/python ( 4328): [INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
I/python ( 4328): [INFO ] [Text ] Provider: sdl2
I/python ( 4328): [WARNING ] [Base ] Unknown provider
I/python ( 4328): [INFO ] [Base ] Start application main loop
I/python ( 4328): [INFO ] [GL ] NPOT texture support is available
I/python ( 4328): [INFO ] [Base ] Leaving application in progress...
I/python ( 4328): Traceback (most recent call last):
I/python ( 4328): File "main.py", line 292, in
I/python ( 4328): TestApp().run()
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/app.py", line 828, in run
I/python ( 4328): runTouchApp()
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/base.py", line 487, in runTouchApp
I/python ( 4328): EventLoop.window.mainloop()
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/core/window/window_sdl2.py", line 633, in mainloop
I/python ( 4328): self._mainloop()
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/core/window/window_sdl2.py", line 388, in _mainloop
I/python ( 4328): EventLoop.idle()
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/base.py", line 330, in idle
I/python ( 4328): self.dispatch_input()
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/base.py", line 315, in dispatch_input
I/python ( 4328): post_dispatch_input(*pop(0))
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/base.py", line 221, in post_dispatch_input
I/python ( 4328): listener.dispatch('on_motion', etype, me)
I/python ( 4328): File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:7726)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/core/window/init.py", line 1040, in on_motion
I/python ( 4328): self.dispatch('on_touch_up', me)
I/python ( 4328): File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:7726)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/core/window/init.py", line 1076, in on_touch_up
I/python ( 4328): if w.dispatch('on_touch_up', touch):
I/python ( 4328): File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:7726)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/screenmanager.py", line 1105, in on_touch_up
I/python ( 4328): return super(ScreenManager, self).on_touch_up(touch)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/widget.py", line 454, in on_touch_up
I/python ( 4328): if child.dispatch('on_touch_up', touch):
I/python ( 4328): File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:7726)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/relativelayout.py", line 294, in on_touch_up
I/python ( 4328): ret = super(RelativeLayout, self).on_touch_up(touch)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/widget.py", line 454, in on_touch_up
I/python ( 4328): if child.dispatch('on_touch_up', touch):
I/python ( 4328): File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:7726)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/widget.py", line 454, in on_touch_up
I/python ( 4328): if child.dispatch('on_touch_up', touch):
I/python ( 4328): File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:7726)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/filechooser.py", line 544, in on_touch_up
I/python ( 4328): return super(FileChooserController, self).on_touch_up(touch)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/relativelayout.py", line 294, in on_touch_up
I/python ( 4328): ret = super(RelativeLayout, self).on_touch_up(touch)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/widget.py", line 454, in on_touch_up
I/python ( 4328): if child.dispatch('on_touch_up', touch):
I/python ( 4328): File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:7726)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/widget.py", line 454, in on_touch_up
I/python ( 4328): if child.dispatch('on_touch_up', touch):
I/python ( 4328): File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:7726)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/scrollview.py", line 808, in on_touch_up
I/python ( 4328): if self.dispatch('on_scroll_stop', touch):
I/python ( 4328): File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:7726)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/scrollview.py", line 843, in on_scroll_stop
I/python ( 4328): self.simulate_touch_down(touch)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/scrollview.py", line 577, in simulate_touch_down
I/python ( 4328): ret = super(ScrollView, self).on_touch_down(touch)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/widget.py", line 432, in on_touch_down
I/python ( 4328): if child.dispatch('on_touch_down', touch):
I/python ( 4328): File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:7726)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/scatter.py", line 510, in on_touch_down
I/python ( 4328): if super(Scatter, self).on_touch_down(touch):
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/widget.py", line 432, in on_touch_down
I/python ( 4328): if child.dispatch('on_touch_down', touch):
I/python ( 4328): File "kivy/_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:7726)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/widget.py", line 432, in on_touch_down
I/python ( 4328): if child.dispatch('on_touch_down', touch):
I/python ( 4328): File "kivy/_event.pyx", line 714, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:7681)
I/python ( 4328): File "kivy/_event.pyx", line 1224, in kivy._event.EventObservers.dispatch (kivy/_event.c:13524)
I/python ( 4328): File "kivy/_event.pyx", line 1108, in kivy._event.EventObservers._dispatch (kivy/_event.c:12356)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/lang/builder.py", line 64, in custom_callback
I/python ( 4328): exec(kvlang.co_value, idmap)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/data/style.kv", line 378, in
I/python ( 4328): on_touch_down: self.collide_point(*args[1].pos) and ctx.controller().entry_touched(self, args[1])
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/uix/filechooser.py", line 605, in entry_touched
I/python ( 4328): self.selection = [abspath(join(self.path, entry.path)), ]
I/python ( 4328): File "kivy/properties.pyx", line 410, in kivy.properties.Property.set (kivy/properties.c:5172)
I/python ( 4328): File "kivy/properties.pyx", line 735, in kivy.properties.ListProperty.set (kivy/properties.c:11327)
I/python ( 4328): File "kivy/properties.pyx", line 448, in kivy.properties.Property.set (kivy/properties.c:5934)
I/python ( 4328): File "kivy/properties.pyx", line 503, in kivy.properties.Property.dispatch (kivy/properties.c:6615)
I/python ( 4328): File "kivy/_event.pyx", line 1224, in kivy._event.EventObservers.dispatch (kivy/_event.c:13524)
I/python ( 4328): File "kivy/_event.pyx", line 1106, in kivy._event.EventObservers._dispatch (kivy/_event.c:12328)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/kivy/lang/builder.py", line 64, in custom_callback
I/python ( 4328): exec(kvlang.co_value, idmap)
I/python ( 4328): File "", line 30, in
I/python ( 4328): File "main.py", line 276, in update_stat
I/python ( 4328): self.imgstat.text = dp.scan(label_stat)
I/python ( 4328): File "main.py", line 232, in scan
I/python ( 4328): test_img = self.convert(imgpath,PIXELS) # Converting the image to tiff file with 96 pixels
I/python ( 4328): File "main.py", line 134, in convert
I/python ( 4328): blurred = img.filter(ImageFilter.BLUR)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/PIL/Image.py", line 805, in filter
I/python ( 4328): self.load()
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/PIL/ImageFile.py", line 164, in load
I/python ( 4328): self.load_prepare()
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/PIL/ImageFile.py", line 231, in load_prepare
I/python ( 4328): self.im = Image.core.new(self.mode, self.size)
I/python ( 4328): File "/data/data/org.test.fstest/files/lib/python2.7/site-packages/PIL/Image.py", line 37, in getattr
I/python ( 4328): raise ImportError("The _imaging C module is not installed")
I/python ( 4328): ImportError: The _imaging C module is not installed
D/dalvikvm( 4328): GC_CONCURRENT freed 856K, 11% free 7684K/8580K, paused 3ms+2ms, total 20ms
I/python ( 4328): Python for android ended.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@TheOpenSourceNinja
Copy link

I too am encountering this problem

@AndreMiras
Copy link
Member

Pillow now has a working recipe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants