4

I am trying to install win32gui using pip and i am getting syntax error. I am using Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32

the error i am getting

    Collecting win32gui
  Using cached win32gui-221.5.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\rnandi~1\appdata\local\temp\pip-build-koonix\win32gui\setup.py", line 27, in <module>
        from win32.distutils.gui import win32gui_build_ext
      File "win32\distutils\gui.py", line 10
        def iter_mfc(plat_name: str) ->Iterator[str]:
                              ^
    SyntaxError: invalid syntax

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

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

tried upgrading pip and uninstalled python and reinstalled.

Rakshith Nt
  • 129
  • 7

1 Answers1

0

This syntax is implemented starting with Python 3 (PEP-3107). In short, win32gui doesn't appear to be compatible with Python 2.7. I just hit this same problem myself, installed Python 3.6.5, and verified that 'pip install win32gui' works without issue.

theoneandonly2
  • 721
  • 1
  • 9
  • 21