简体   繁体   English

Kivy Buildozer-安装setuptools之后,“没有名为setuptools的模块”

[英]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-setuptoolssudo -H pip uninstall setuptools ,并且从/ usr / local / bin中删除了easy_install命令( easy_installeasy_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.

相关问题 Kivy buildozer 调试错误:没有名为 kivy 的模块 - Kivy buildozer debug error :No module named kivy Kivy Buildozer python3 错误:“ImportError: No module named 'requests'” - Kivy Buildozer python3 error: " ImportError: No module named 'requests' " 应用程序在 buildozer android 调试中崩溃 - 没有名为“kivy._event”的模块 - App crashed in buildozer android debug - no module named 'kivy._event" 使用 Buildozer 为 Google API 编译 Kivy 应用程序 - 没有名为“google.api_core”的模块 - Compile Kivy app with Buildozer for Google API - No module named 'google.api_core' Kivy 期间没有名为 google 的模块到带有 Buildozer 的 apk - No moduled named google during Kivy to apk with Buildozer ipython:没有名为“kivy”的模块 - ipython: No module named 'kivy' Python Kivy-Buildozer APK 未安装 - 在 Android 10 上运行? - Python Kivy-Buildozer APK not installing - running on Android 10? 带有Buildozer的Kivy pyjnius-将jnius添加到应用程序会导致启动后崩溃 - Kivy pyjnius with Buildozer - Adding jnius to the app causes it to crash after starting it 我的 kivy 应用程序在安装后崩溃,通过 buildozer 成功构建 - My kivy app is crashing after installation, build successfully through buildozer 一周后我对 kivy 和 buildozer 有问题 - i have problem with kivy and buildozer after a week it works
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM