如何让pythonforandroid的安装程序脚本识别Windows系统上已安装的pbs?

2024-06-26 01:53:10 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用given here安装Python for Android。我的目标是为一个基于Pygame的游戏构建一个APK文件,它已经准备好并可以在Python中工作。我在Windows10Home32位系统上运行python2.7.1132位。在

如图所示,我最初被告知要安装pbs,因为我使用的是Windows系统。我这样做,安装似乎继续成功。在

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

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

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


Tags: pipinfrompygitforwindowssh
1条回答
网友
1楼 · 发布于 2024-06-26 01:53:10

python-for-android is not supported on Windows.

This is just the first small example of many issues you'll come across if you try it. There's a PR that does a lot of the work, but it's considered just a proof of concept unless someone wants to polish it and maintain it.

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

相关问题 更多 >