1

Always, when I want to use Python framework pygame and I want to compile it, it's printing this:

    Traceback (most recent call last):
  File "/home/hanisek/game.py", line 1, in <module>
    import pygame
  File "/home/hanisek/pygame.py", line 3
    03f3 0d0a 5fff 9355 6300 0000 0000 0000
       ^
SyntaxError: invalid syntax

Do you know why?

1 Answer 1

1

You are not importing pygame the framework, you are importing pygame.py, a file in the same directory:

    import pygame
  File "/home/hanisek/pygame.py", line 3

Remove or rename that file.

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

1 Comment

It's interesting. I installed pygame, but.. It didn't work.. I reinstalled it, removed pygame.py and it actually work!

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.