[英]Kivy Buildozer - “No module named setuptools” after installing setuptools
I have a Flask server in a Python file. 我在Python文件中有一个Flask服务器。 It's really simple:
这很简单:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return "Hello World!"
if __name__ == '__main__':
app.run()
I'm using Kivy's Buildozer to build my file. 我正在使用Kivy的Buildozer构建文件。 After creating
buildozer.spec
and specifying requirements = kivy,flask
I try to build with buildozer -v android debug
which should build the APK. 在创建
buildozer.spec
并指定了requirements = kivy,flask
我尝试使用buildozer -v android debug
进行构建,以构建APK。
Instead, it crashes in the middle of building and gives me this error: 相反,它在建筑物中间崩溃,并给我这个错误:
File "setup.py", line 4, in
文件“ setup.py”,第4行,在
from setuptools import setup
从setuptools导入设置
ImportError: No module named setuptools
ImportError:没有名为setuptools的模块
This setup.py
is Buildozer's, not mine. 这个
setup.py
是Buildozer的,不是我的。
I uninstalled setuptools completely with sudo apt-get purge python-setuptools
, sudo -H pip uninstall setuptools
, and I removed the easy_install command from /usr/local/bin (both easy_install
and easy_install-2.7
). 我使用
sudo apt-get purge python-setuptools
, sudo -H pip uninstall setuptools
,并且从/ usr / local / bin中删除了easy_install命令( easy_install
和easy_install-2.7
)。 I run sudo easy_install
and it says it's not there. 我运行
sudo easy_install
,它说不存在。 Good. 好。
Then I follow instructions from here , and I run wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python
然后,按照这里的说明进行操作,然后运行
wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python
wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python
. wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python
。 It installs successfully, and I test that easy_install is there by doing sudo easy_install
and checking at /usr/local/bin
. 它安装成功,我通过执行
sudo easy_install
并检查/usr/local/bin
测试easy_install是否存在。 I also go into the Python shell and type from setuptools import setup
and it works. 我也进入Python shell,并
from setuptools import setup
键入,它可以工作。 So, setuptools is installed. 因此,安装了setuptools。 However,
buildozer -v android debug
still fails with the same error. 但是,
buildozer -v android debug
仍然失败,并显示相同的错误。
Could someone figure out what's happening? 有人能弄清楚发生了什么吗? Setuptools is installed;
安装了Setuptools; why is Buildozer not finding it?
为什么Buildozer找不到它?
This is my log, with log_level = 2 in buildozer.spec: Link 这是我的日志,在buildozer.spec中的log_level = 2: 链接
You are using the old python-for-android toolchain, which does not support a flask backend. 您正在使用旧的python-for-android工具链,该工具链不支持Flask后端。 Run
buildozer android_new debug
instead to use the new toolchain. 改为运行
buildozer android_new debug
来使用新的工具链。
Try to figure out which python binary (environment) does the buildozer use. 尝试找出buildozer使用哪个python二进制文件(环境)。 My guess that it uses another one then the one you think, and there setuptools isn't installed.
我猜想它会使用另一个,而不是您认为的那个,并且没有安装setuptools。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.