2017-07-16 39 views
1

我正在尝试使用Buildozer从使用Python 3.5编写的Kivy项目构建APK。一切都安装在virtualenv内。当我运行:如何在virtualenv下运行buildozer?

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

看起来像a known problem与buildozer。我的解决方案是在虚拟环境中将pip重命名为pip.real,并用shell脚本替换pip,该脚本从参数中删除--user并将参数传递到pip.real。像this但不完全。可能是这样的:

#! /bin/sh 
args='' 
for arg in "[email protected]"; do 
    [ "$arg" == "--user" ] || args="$args $arg" 
done 
exec pip.real "$args 
相关问题