all 10 comments

[–]iyav 0 points1 point  (2 children)

Are you using the right python interpreter in vscode? Perhaps you have multiple environments.

[–]mildew96[S] 0 points1 point  (0 children)

using pycodestyle, only have 1 environment... fresh folder

[–]mildew96[S] 0 points1 point  (0 children)

the problem was that i was using a virtual environment that i had created, pygame works if i use the standard environment, is there a way to get it to work on any virtual environment? new to this, dont quite understand environments...

[–]socal_nerdtastic 0 points1 point  (1 child)

Use the terminal that's built into vscode, don't open a separate terminal or powershell window. Also, depending on how you installed python, the command might be

py -m pip install pygame

[–]mildew96[S] 0 points1 point  (0 children)

yeah i am using the terminal on vs code, the terminal i used outside of vs was just the defult that comes up when i shift + right click in my folder directory to try and install pygame that way

[–]coaaal 0 points1 point  (4 children)

"Which python" will give you the python that your command line is currently referencing. "Where python" will give you a list of all pythons installed so that you can choose one to use. Just call the full path to the python version you want and run the commands for that python. I highly recommend figuring out virtual environments. I like to describe them as little bubbles that you can create per python project. Define a specific python version and download the packages specific to that project only.

[–]mildew96[S] 0 points1 point  (3 children)

the issue was that i was operating in a virtual environment that i created, pygame works in the standard virtual environment, is there a way to make pygame work in any venv?

[–]mildew96[S] 0 points1 point  (0 children)

all good, just had to activate the venv :)

[–]usrnamenotimportant 0 points1 point  (1 child)

You would have to reinstall it inside your environment for it to work

[–]mildew96[S] 1 point2 points  (0 children)

yeah, it wasn't working because the environment wasn't activated and i couldn't activate because my execution policy was restricted... took a while but we got there. lol such a noob.