【问题标题】:How do I get python-for-android's installer script to recognize the installed pbs on a Windows system?如何让 python-for-android 的安装程序脚本识别 Windows 系统上已安装的 pbs?
【发布时间】:2016-06-13 17:27:59
【问题描述】:

我正在尝试使用说明given here 安装 Python-for-Android。我的目标是为基于 Pygame 的游戏构建一个 APK 文件,该游戏已准备好并在 Python 中运行。我在 Windows 10 Home 32 位系统上运行 Python 2.7.11 32 位。

如此处所示,由于我使用的是 Windows 系统,因此最初被告知要安装 pbs。我这样做了,安装似乎成功进行。

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>CD C:\Users\RetailAdmin

C:\Users\RetailAdmin>pip install git+https://github.com/kivy/python-for-android.git
Collecting git+https://github.com/kivy/python-for-android.git
  Cloning https://github.com/kivy/python-for-android.git to c:\users\retail~1\appdata\local\temp\pip-g81ofc-build
Collecting appdirs (from python-for-android==0.3)
  Downloading appdirs-1.4.0-py2.py3-none-any.whl
Collecting colorama>=0.3.3 (from python-for-android==0.3)
  Downloading colorama-0.3.7-py2.py3-none-any.whl
Collecting sh>=1.10 (from python-for-android==0.3)
  Downloading sh-1.11.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\retail~1\appdata\local\temp\pip-build-ihr19r\sh\setup.py", line 4, in <module>
        import sh
      File "sh.py", line 37, in <module>
        support." % __version__)
    ImportError: sh 1.11 is currently only supported on linux and osx. please install pbs 0.110 (http://pypi.python.org/pypi/pbs) for windows support.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\retail~1\appdata\local\temp\pip-build-ihr19r\sh\

C:\Users\RetailAdmin>pip install pbs
Collecting pbs
  Downloading pbs-0.110.tar.gz
Building wheels for collected packages: pbs
  Running setup.py bdist_wheel for pbs ... done
  Stored in directory: C:\Users\RetailAdmin\AppData\Local\pip\Cache\wheels\83\a4\ed\de1e93a8fd1250a18a2d3fe79b07755188cfc1538144a6cc46
Successfully built pbs
Installing collected packages: pbs
Successfully installed pbs-0.110

但是,当我尝试再次运行第一个命令(用于安装 python-for-android)时,安装脚本仍然无法识别 pbs 已安装。返回与上面给出的非常相似的输出,主要区别在于它不是再次下载 appdirs / colorama 等,而是使用缓存的副本。它最终还是选择 sh 1.11,然后建议选择 pbs 0.110,因为它是 Windows 系统。

我已确认即使我关闭命令提示符(以管理员身份运行)并启动新会话(再次以管理员身份),此行为仍会继续。我还查看了here 给出的命令文档,但没有任何特定于 pbs 或 sh 甚至 Windows 的东西。 更让我困惑的是,上面提到的快速入门页面列出了许多依赖项,但它们也没有谈论 pbs 或 sh。我已验证 setuptools 已安装。

【问题讨论】:

    标签: android python windows python-2.7 pygame


    【解决方案1】:

    python-for-android 在 Windows 上不受支持。

    这只是您在尝试时会遇到的许多问题的第一个小例子。 有一个 PR 做了很多工作,但它被认为只是一个 概念证明,除非有人想对其进行完善和维护。

    https://github.com/kivy/python-for-android/issues/1817

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-05-29
      • 1970-01-01
      • 2016-11-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多