【发布时间】: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