Buildozer错误-"安装mpmath版本>=0.19
我正在尝试使用Buildozer来部署一个安卓应用,这个应用是用Kivy开发的,基于Sympy这个库。
出现了以下错误信息:
STDOUT:
Please install the mpmath package with a version >= 0.19
STDERR:
# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain
create --dist_name=myapp --bootstrap=sdl2 --
requirements=python3,kivy,sympy --arch armeabi-v7a
--copy-libs --color=always --
storage-dir="/home/ohad/Scalc/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21
. . . .
# 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
这是我脚本中的导入部分,不包括Kivy的导入:
from sympy import *
from sympy.parsing.sympy_parser import parse_expr
from sympy.parsing.sympy_parser import standard_transformations, \
implicit_multiplication_application
更新: 在没有使用sympy的情况下尝试部署后,成功了,但应用在手机上立刻崩溃,所以肯定是mpmath或sympy的问题。
命令的完整输出是:sudo buildozer android debug deploy run
https://github.com/Ohadforman/Error-buildozer/blob/master/Error
有没有什么想法?
相关问题:
- 暂无相关问题
1 个回答
4
我找到了解决办法。
- 你需要在你的Python环境中安装mpmath这个库。
- 把mpmath文件夹剪切或复制到其他地方。
- 找到你项目中的sympy文件夹,路径大概是project_folder/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/sympy/armeabi-v7a__ndk_target_21/sympy,注意有些文件夹的名字可能会不同。
- 把mpmath文件夹粘贴到第三步找到的文件夹里。
希望这对你有帮助,对我来说是有效的。
另外,当我尝试在新项目中这样做时并不成功。第一次你应该在spec文件中不添加sympy,先构建项目,之后再在spec文件中添加sympy,并把mpmath模块放到我提到的文件夹里。