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

Using Cython with Kivy-iOS and Buildozer #472

Closed
mbrockman1 opened this issue Feb 16, 2017 · 1 comment
Closed

Using Cython with Kivy-iOS and Buildozer #472

mbrockman1 opened this issue Feb 16, 2017 · 1 comment

Comments

@mbrockman1
Copy link

mbrockman1 commented Feb 16, 2017

This is a cross-post from Kivy-iOS, I am unsure which one is the best to post this issue.I am trying to use Cython in my Kivy-iOS app. My current method is using pyximport.install('clock.pyx'). This works fine on my local machine however, I get the error below when I try to run the same code on my iPhone simulator.

2017-02-15 11:44:47.399 timing[6789:4913845] PythonHome is: /Users/michael/Library/Developer/CoreSimulator/Devices/860ADC0E-43FD-4602-8C24-671E29FB8CC7/data/Containers/Bundle/Application/8CC52FB8-423D-40D4-9E24-0B82801FA469/timing.app
2017-02-15 11:44:47.402 timing[6789:4913845] Initializing python
2017-02-15 11:44:47.447 timing[6789:4913845] Running main.pyo: /Users/michael/Library/Developer/CoreSimulator/Devices/860ADC0E-43FD-4602-8C24-671E29FB8CC7/data/Containers/Bundle/Application/8CC52FB8-423D-40D4-9E24-0B82801FA469/timing.app/YourApp/main.pyo
[INFO              ] [Kivy        ] v1.9.1
[INFO              ] [Python      ] v2.7.1 (r271:86832, Feb 14 2017, 14:03:25)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]
[INFO              ] [Factory     ] 179 symbols loaded
failed to import Cython: dynamic module does not define init function (initScanning)
 Traceback (most recent call last):
   File "/Users/michael/virtualenv/kivy-ios/timing/.buildozer/ios/platform/kivy-ios/timing-ios/YourApp/main.py", line 1, in <module>
   File "/Users/michael/virtualenv/kivy-ios/timing/.buildozer/ios/platform/kivy-ios/timing-ios/YourApp/smile/common.py", line 14, in <module>
   File "/Users/michael/virtualenv/kivy-ios/timing/.buildozer/ios/platform/kivy-ios/timing-ios/YourApp/smile/experiment.py", line 26, in <module>
   File "/Users/michael/virtualenv/kivy-ios/timing/.buildozer/ios/platform/kivy-ios/timing-ios/YourApp/smile/state.py", line 23, in <module>
   File "/Users/michael/virtualenv/kivy-ios/timing/.buildozer/ios/platform/kivy-ios/timing-ios/YourApp/_applibs/pyximport/pyximport.py", line 435, in load_module
   File "/Users/michael/virtualenv/kivy-ios/timing/.buildozer/ios/platform/kivy-ios/timing-ios/YourApp/_applibs/pyximport/pyximport.py", line 227, in load_module
   File "/Users/michael/virtualenv/kivy-ios/timing/.buildozer/ios/platform/kivy-ios/timing-ios/YourApp/_applibs/pyximport/pyximport.py", line 209, in load_module
   File "/Users/michael/virtualenv/kivy-ios/timing/.buildozer/ios/platform/kivy-ios/timing-ios/YourApp/_applibs/pyximport/pyximport.py", line 186, in build_module
   File "/Users/michael/virtualenv/kivy-ios/timing/.buildozer/ios/platform/kivy-ios/timing-ios/YourApp/_applibs/pyximport/pyxbuild.py", line 100, in pyx_to_dll
   File "/Users/michael/virtualenv/kivy-ios/timing/.buildozer/ios/platform/kivy-ios/dist/root/python/lib/python2.7/distutils/dist.py", line 953, in run_commands
   File "/Users/michael/virtualenv/kivy-ios/timing/.buildozer/ios/platform/kivy-ios/dist/root/python/lib/python2.7/distutils/dist.py", line 972, in run_command
   File "/Users/michael/virtualenv/kivy-ios/timing/.buildozer/ios/platform/kivy-ios/timing-ios/YourApp/_applibs/Cython/Distutils/build_ext.py", line 164, in run
   File "/Users/michael/virtualenv/kivy-ios/timing/.buildozer/ios/platform/kivy-ios/dist/root/python/lib/python2.7/distutils/command/build_ext.py", line 340, in run
   File "/Users/michael/virtualenv/kivy-ios/timing/.buildozer/ios/platform/kivy-ios/timing-ios/YourApp/_applibs/Cython/Distutils/build_ext.py", line 171, in build_extensions
   File "/Users/michael/virtualenv/kivy-ios/timing/.buildozer/ios/platform/kivy-ios/timing-ios/YourApp/_applibs/Cython/Distutils/build_ext.py", line 190, in cython_sources
 ImportError: Building module smile.clock failed: ['DistutilsPlatformError: Cython does not appear to be installed\n']
2017-02-15 11:44:47.696 timing[6789:4913845] Application quit abnormally!
2017-02-15 11:44:47.706 timing[6789:4913845] Leaving```

I have looked at other sites that have had luck with using Cython in their iOS apps such as, http://shadowmint.blogspot.com/2013/10/kivy-cython-extensions-and-ios.html?view=timeslide, however his kivy-ios fork is 4+ years old and no longer works. Has anyone had success with using Cython and Kivy-iOS. I would love to know the methodology behind it.
@tito
Copy link
Member

tito commented May 15, 2017

Hi, i saw this issue somewhere else, maybe as you said on Kivy-ios. You cannot use Cython on the target, as you don't just require Cython, but also full environment to compile.
pyxinstall from Cython is supposed to be easy to test, but not meant for production. Switch to compile your own python extension by writing a kivy-ios/python-for-android recipe. It is harder than that :/

@tito tito closed this as completed May 15, 2017
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

2 participants