2017-10-05 17 views
1

最近、buildozerは簡単な"hello world"プログラムをコンパイルしました。SQLAlchemyをbuildozerで使用するには?

しかし、main.pyファイルでSQLAlchemyを使用したいと思います。

ファイルが含まれています

# (list) Application requirements 
# comma seperated e.g. requirements = sqlite3,kivy 
requirements = python3crystax,SQLAlchemy,kivy 

# change the major version of python used by the app 
osx.python_version = 3 

# Kivy version to use 
osx.kivy_version = 1.10.0 

# (str) Android NDK version to use 
#android.ndk = 9c 
android.ndk = 10.3.2 

# (str) Android NDK directory (if empty, it will be automatically downloaded.) 
#android.ndk_path = 
android.ndk_path = /opt/crystax-ndk-10.3.2 

GridLayout: 
    cols: 2 
    Label: 
     id: etkt 
     text: 'Etiket' 
    Button: 
     text: 'Tıkla' 
     on_press: app.olustur() 

私はbuildozer.specファイルにnecessarryパーツを変更:

# -*- coding: utf-8 -*- 
import kivy 
kivy.require('1.10.0') 
from kivy.app import App 
from kivy.uix.button import Button 
from sqlalchemy import create_engine 
from kivy.uix.label import Label 

class MyApp(App): 

    def build(self): 
     pass 

    def olustur(self): 
     engine = create_engine('sqlite:///database.db', echo = True) 
     cur = engine.connect() 
     self.root.ids['etkt'].text = 'Bağlantı Başarılı!' 

if __name__ == '__main__': 
    MyApp().run() 

にも含まれていmyapp.kvファイルがあります

しかし、エラーが発生します。

私が学びたいことは、以下のようなスペックファイルの部分も変更する必要がありますか、別のことをする必要がありますか?

# (str) Custom source folders for requirements 
# Sets custom source for any requirements with recipes 
# requirements.source.kivy = ../../kivy 
    requirements.source.SQLAlchemy = .../../SQLAlchemy 

ありがとうございます。

編集:

新しい出力は次のようになります。

[INFO]: Will compile for the following archs: armeabi-v7a 
[INFO]: Found Android API target in $ANDROIDAPI 
[INFO]: Available Android APIs are (19) 
[INFO]: Requested API target 19 is available, continuing. 
[INFO]: Found NDK dir in $ANDROIDNDK 
[INFO]: Got NDK version from $ANDROIDNDKVER 
[WARNING]: NDK version was set as r10.3.2, but checking the NDK dir claims it is 10.3.2. 
[WARNING]: The build will try to continue, but it may fail and you should check that your setting is correct. 
[WARNING]: If the NDK dir result is correct, you don't need to manually set the NDK ver. 
[INFO]: Using Crystax NDK r10.3.2 
[INFO]: Found virtualenv at /usr/bin/virtualenv 
[INFO]: Found the following toolchain versions: ['4.9', '5', 'clang3.6', 'clang3.7'] 
[INFO]: Picking the latest gcc toolchain, here 5 
[INFO]: No existing dists meet the given requirements! 
[INFO]: No dist exists that meets your requirements, so one will be built. 
[ERROR]: Didn't find any valid dependency graphs. 
[ERROR]: This means that some of your requirements pull in conflicting dependencies. 
[ERROR]: Exiting. 
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3crystax,sqlite3,sqlalchemy,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/tanberk/Android3/.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 

答えて

1

レシピ名がsqlalchemy、ないSQLAlchemyです。

私は、この種の問題について以前は考えていませんでした。

+0

私はあなたが正しいと思います。ところで、最近AndroidのapkはPython 2.7で構築されています。 .specファイルでは、requirements = sqlite3、sqlalchemy、kivyという要件が記述されていました。私は再びPython3で試してみます。 –

+0

Python2とPython3の両方で、単純な "hello world"プログラムを作成しました。しかし、このsqlalchemyの例はまだPython3でコンパイルされていません。最初の例のような要件を追加しました。 ndkのバージョンは同じですが、kivyのバージョンは同じです。しかし、それはエラーを与える。奇妙な。おそらく、私はまだ見つけていない何かを間違ったことをしました。 –

+0

sqlalchemyレシピはおそらくpython3でテストされていません。つまり、あなたは[指示](http://python-for-android.readthedocs.io/en/latest/buildoptions/#python3)、特にCrystaX NDKを使用していますか? – inclement

関連する問題