ImportError: No module named win32api

Issue #7 new
Saad Farooq created an issue

I'm getting the above error on Windows in auto_search_win

I can help you with testing and stuff on Windows if you need.

Comments (6)

  1. Sergi Juanola repo owner

    I'm pretty sure that error comes because Python is not linked to the win32 libraries by default. That may be fixed looking at the Python configuration in your pc. However, any help testing, developing or even suggesting would be amazing!

  2. Saad Farooq reporter

    So is that the only API available? It seems weird that the only access sublime provides would be through an API that you have to link manually. Linux and Windows Sublime are supposed to have their own Python interpreters.

  3. Saad Farooq reporter

    OK... I did some stuff. A weird question.

    Can we assume that is someone installed the SDK on Windows. They would probably have command line access to android.bat ?

  4. Sergi Juanola repo owner

    Yes, so every call that does anything with /android would be either cloned to also work with windows, like this:

        if os.name == "nt":
            self.auto_search_win()
        else:
            self.auto_search_unix()
    

    Or it should be adapted using the sublime standards, and avoid using the directory separator in favor of a comma separated list. However in that case, you still need to distinguish between android and android.bat.

    Related to the win32api thing, I've asked in the forums, let's see what they say. This seems a common issue.

  5. Saad Farooq reporter

    okay.. cool... I have it working using a global boolean that saves the os.name comparison.

    I still think the best way would be to just check if it runs somehow and then just run the commands. And prompt the user to add to path other wise. That seems the most cross compatible way to me.

    Anyways, should we probably take this elsewhere ?

  6. Sergi Juanola repo owner

    Yeah, that would probably be the best option to make it work fast. I'll just keep an eye on the forums to check this api issue (sadly the documentation is not as self explanatory as it would).

    Anyways, should we probably take this elsewhere ?

    What do you suggest?

  7. Log in to comment