#๐Ÿ”’ Environment Setup Help

38 messages ยท Page 1 of 1 (latest)

tough rock
#

I'm trying to run python code in vscode and I get this error:

distant pilotBOT
#

@tough rock

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

nimble olive
#

What gave the error?

#

What did u try to run/do

tough rock
#

just pressing the play button on this:

nimble olive
#

Save it

#

The play button runs the code in the file but doesn't save it first

tough rock
#

I saved it

nimble olive
#

If the file is fresh it may even lead to file not found like in ur case

#

Sure?

#

And after that u still get the error?

tough rock
#

I think so?

#

oh it gives me something different when I press the dropdown in the play button and press run python file

nimble olive
#

Did u cut down the path in the error or thats the full thing?

tough rock
#

no module named pygame

#

which
I thought I installed

nimble olive
nimble olive
tough rock
nimble olive
#

Also to make sure u installed for the correct python version u can do "python -m pip"

#

Pip -V
Python -m pip -V

#

Python3 -V

#

Opt/homebrew/bin/python3 -V

tough rock
nimble olive
#

Just looking if any ypthon install is not the one ur looking for

tough rock
#

python3 -m pip -V:
pip 24.2 from /opt/homebrew/lib/python3.13/site-packages/pip (python 3.13)

nimble olive
tough rock
#

python -m pip -V:
zsh: command not found: python

tough rock
nimble olive
#

Nothing

#

Just replace ur interpreter path with homebrew/lib/python3.13

#

And use the same path -m pip instead of pip

tough rock
nimble olive
#

Run
/opt/homebrew/lib/python3.13 -m pip install pygame
Than
/opt/homebrew/lib/python3.13 path/to/code

tough rock
#

Okay great thank you!

distant pilotBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.