Home > database >  Why is my VS Code not rendering graphics windows
Why is my VS Code not rendering graphics windows

Time:10-06

I am trying to use pygame to render a TicTacToe game, but it appears that when I run the code nothing happens. But, it looks to me that the code is running perfectly fine, it is just that the pygame graphics window is not popping up.

After a fair amount of troubleshooting, I believe that the problem resides with my VS Code permissions and not in the code itself. I tried to run the following code

import turtle
geoff = turtle.Turtle()

geoff.forward(100)

input("Press any key to exit ...")

To see if the graphics window would pop up for this code, but it doesn't.

Please help me figure out how to get my graphics window working.

Kind regards,

CodePudding user response:

Try to install tkinter. If you are in you venv activated:

pip install tk

else:

your/path/to/python3 -m pip install tk

CodePudding user response:

Thanks @matleg and @toyota Supra for your contributions.

It seems that the issue has something to do with my codespace in VS code. I am using the cs50 codespace provided by Harvard's cs50 course. And that for some reason cannot access my tkinter package.

But, I ran pygame outside of the codespace and it runs perfectly.

  • Related