如何在virtualenv下运行buildozer?

时间:2017-07-16 12:26:23

标签: android python-3.x pip kivy buildozer

我正在尝试使用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跳过这个标志?或者可能有不同的解决方案?

感谢您提前。

1 个答案:

答案 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}}