我正在尝试使用Buildozer从用Python 3.5编写的Kivy项目构建一个APK。一切都安装在virtualenv中。我跑的时候:
buildozer -v android debug
我收到以下错误:
Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
# Command failed: pip install -q --user "appdirs" "colorama>=0.3.3" "sh>=1.10" "jinja2" "six"
#
# 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
我理解标志--user
在virtualenv中没有意义。可能默认情况下,Buildozer不是在virtualenv下工作。有没有办法说Buildozer跳过这个标志?或者可能有不同的解决方案?
感谢您提前。
答案 0 :(得分:0)
似乎有a known problem和buildozer。我的解决方案是在虚拟环境中将pip.real
重命名为pip
,并将--user
替换为从参数中删除pip.real
的shell脚本,并将args传递给#! /bin/sh
args=''
for arg in "$@"; do
[ "$arg" == "--user" ] || args="$args $arg"
done
exec pip.real "$args
。像this这样的东西,但不完全正确。可能是这样的:
{{1}}