0

I am using windows 10 home edition 64-bit edition. I am using python 3.6 64-bit edition. I have tried to solve the error by running a clean install of python but that didn't solve the problem.

I tried to install pygame via pip, but the following results were produced:

    C:\Windows\system32>pip install pygame
    Collecting pygame
      Using cached pygame-1.9.2.tar.gz
        Complete output from command python setup.py egg_info:


    WARNING, No "Setup" File Exists, Running "config.py"
    Using WINDOWS configuration...

    Path for SDL not found.
    Too bad that is a requirement! Hand-fix the "Setup"
    Path for FONT not found.
    Path for IMAGE not found.
    Path for MIXER not found.
    Path for PNG not found.
    Path for JPEG not found.
    Path for PORTMIDI not found.
    Path for COPYLIB_tiff not found.
    Path for COPYLIB_z not found.
    Path for COPYLIB_vorbis not found.
    Path for COPYLIB_ogg not found.

    If you get compiler errors during install, doublecheck
    the compiler flags in the "Setup" file.


    Continuing With "setup.py"
    Error with the "Setup" file,
    perhaps make a clean copy from "Setup.in".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\*****~1\AppData\Local\Temp\pip-build-ciac4jty\pygame\setup.py", line 165, in <module>
        extensions = read_setup_file('Setup')
      File "c:\program files\python36\lib\distutils\extension.py", line 171, in read_setup_file
        line = expand_makefile_vars(line, vars)
      File "c:\program files\python36\lib\distutils\sysconfig.py", line 410, in expand_makefile_vars
        s = s[0:beg] + vars.get(m.group(1)) + s[end:]
    TypeError: must be str, not NoneType

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\*****~1\AppData\Local\Temp\pip-build-ciac4jty\pygame\

What caused this error? How do I solve it?

4
  • 2
    pip is working just fine. It is that specific package that fails. pygame doesn't appear to be Python 3.6 compatible yet. Commented Jan 4, 2017 at 12:02
  • This discussion may also be useful: reddit.com/r/pygame/comments/4dv1uu/… Commented Jan 5, 2017 at 5:54
  • @MartijnPieters I have Python 3.6.0 with pygame working perfectly. It is compatible and has been since September. See my answer for clarification. Commented Jan 13, 2017 at 11:19
  • @Arbiter: I suspect that Gohlke applied some patches from the repository to make the build work on 3.6. Also, you installed a wheel, so you would never have run the setup.py file yourself. Last but not least, I note I said appear. I didn't test installation on Windows (I have no Windows machines), so it could be a Windows issue too. Commented Jan 13, 2017 at 11:38

1 Answer 1

1

pygame isn't (officially) compatible with Python 3.6 yet(Jan 5, 2017). Try a lower version of Python like 3.5.2

Sign up to request clarification or add additional context in comments.

5 Comments

@Arbiter: the official release perhaps is not, you downloaded a third-party build for Windows. No setup.py is run in that case.
@Arbiter: But not everyone uses Windows. Can you install pygame on 3.6 on all platforms without issue?
@Arbiter: I'm glad things work for you, but don't assume that just because it did the issue in the question doesn't apply to others.
@Arbiter: Again, great you got it working. What I'm taking issue with is calling the other posts here wrong. There is no need to take so much issue with the existing body of comments and answers.
@Arbiter: your answer has been here barely half a day. The OP is free to change their accepted answer. In the meantime, learn to always look at the other answers on a question as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.