How do I get python-for-android's installer script to recognize the installed pbs on a Windows system?

by Hiren   Last Updated August 14, 2019 18:26 PM

I am trying to install Python-for-Android by using the instructions given here . My aim is to build an APK file for a Pygame-based game which is ready and working in Python. I am running Python 2.7.11 32-bit on a Windows 10 Home 32-bit system.

As seen here, I am initially told to install pbs since I am using a Windows system. I do that and the installation appears to proceed successfully.

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+
Collecting git+
  Cloning 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 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\", line 4, in <module>
        import sh
      File "", line 37, in <module>
        support." % __version__)
    ImportError: sh 1.11 is currently only supported on linux and osx. please install pbs 0.110 ( for windows support.

Command "python 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 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

However, when I try to run the first command again (for installing python-for-android), the setup script still doesn't recognize that pbs has been installed. Very similar output as that given above is returned, with the main difference being that instead of downloading appdirs / colorama etc. again, it uses the cached copies. It still ends up going for sh 1.11 and then suggests to go for pbs 0.110 since it is a Windows system.

I have confirmed that this behavior continues even if I close the command prompt (which was being run as administrator) and start a new session(again as administrator). I also had a look at the commands documentation given here but there is nothing specific to pbs or sh or to even Windows as such. What is confusing me more is that the quickstart page mentioned above lists many dependencies, but they too don't talk about pbs or sh. I have verified that setuptools is installed.

Answers 1

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.

Pedro Lobito
Pedro Lobito
August 14, 2019 18:25 PM

Related Questions

Dealing with large numbers for space physics

Updated June 27, 2019 12:26 PM

Cant pickle a pygame sprite

Updated October 04, 2017 14:26 PM

How to store Class Variables in list?

Updated January 22, 2019 02:26 AM