-1

I have installed pygame in the terminal but I cannot find it in vscode and get an error.

Edit:

I found that I was using the wrong python interpreter see my later answer

Moose
  • 5
  • 4
  • 2
    Do you have multiple Python installations? – Rabbid76 Jan 08 '22 at 22:09
  • How do I check that @Rabbid76? I know I have (and use) python 3.9 but I don't know if I have another installation – Moose Jan 09 '22 at 00:03
  • Does this answer your question? [Module not found error in VS code despite the fact that I installed it](https://stackoverflow.com/questions/56658553/module-not-found-error-in-vs-code-despite-the-fact-that-i-installed-it) – Tomerikoo Jan 09 '22 at 12:12

3 Answers3

0

Try

Pip install pygame

on the vscode terminal.

If that doesn’t work check this out:

i can't import pygame in visual studio code

Golopogus
  • 41
  • 1
  • 2
  • Neither of those worked for me – Moose Jan 08 '22 at 23:03
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 09 '22 at 02:17
0

Main reason I see is your project is not configured correctly. probably not the right interpreter or virtual environment. have a look on your settings and see that anything looks as it should be(right python version).

have a look: Module not found error in VS code despite the fact that I installed it

Michael L
  • 1
  • 1
  • How do I check that? – Moose Jan 08 '22 at 23:03
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 08 '22 at 23:53
0

Original answer - by @MOStudios (me)

Two possible solutions

Check the python interpreter being used

When any .py file is open in the editor and is currently being used, near the bottom left, it says Python <version> <32/64>-bit. Tap it and select the directory that contains the python interpreter version that has kivy installed.

Check the following image for any help

Click on the highlighted area in the bottom left

The platform I was using was a chromebook, but the location of changing the editor is the same

Manually install within VScode

Run pip install kivy to ensure that vscode uses it

MOStudios
  • 540
  • 3
  • 12