【问题标题】:How to run buildozer under virtualenv?如何在 virtualenv 下运行 buildozer?
【发布时间】:2017-12-21 01:35:45
【问题描述】:

我正在尝试使用 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 在 vi​​rtualenv 中没有意义。可能默认情况下,Buildozer 不在 virtualenv 下工作。有没有办法让 Buildozer 跳过这个标志?或者可能有不同的解决方案?

感谢您的提前。

【问题讨论】:

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


    【解决方案1】:

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

    #! /bin/sh
    args=''
    for arg in "$@"; do
        [ "$arg" == "--user" ] || args="$args $arg"
    done
    exec pip.real "$args
    

    【讨论】:

      猜你喜欢
      • 2018-06-09
      • 1970-01-01
      • 2020-04-25
      • 2013-08-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多