I'm not much of a coder, but I've been tinkering with local LLMs and Ollama lately. I wanted to test how good they were at coding, and I decided to use python as a test language since I know it's very popular, and I figured it would be nice to have it on my computer. Long story short, none of its code was working and I think its because it was trying to use a library called pygame, and it was having trouble installing it. I went to install it manually, which I'm apparently supposed to do using "pip install pygame" on the console. It didn't work, and I got this error message instead ("'pip' is not recognized as an internal or external command, operable program or batch file."). I've been trying to fix this for a while now and I can't seem to figure it out, I think I need to add it to PATH or something (I'm not totally sure what that means), can anybody help me? Sorry in advance if I can't respond right away.
#đź”’ Pip isn't recognized in the cmd prompt
13 messages · Page 1 of 1 (latest)
@proud siren
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.
You want:
py -m pip install pygame
If using the latest python, pygame might not install. I suggest installing pygame-ce instead. It works the same as the old pygame but is better maintained and updated
Thanks, I will try that. One question though, why am I seeing everywhere that the correct command is pip install pygame if it’s actually something else? That’s also probably what my ai was trying to do.
Your AI?
I said that I’m tinkering with ollama (locally run ai) and I was using python as a test language
Is the “py -m pip install pygame” a newer command or something?
pip (when it's there) is traditionally the command to install into your default python.
For various reasons we always recommend:
python -m pip install whatever
(adjusting python suitably, eg py for you because you're on Windows).
First: that runs the pip for that specific python, and therefore installs where that python will find it. When you've got multiple pythons or venvs or whatever, that matters.
Second: these days the "system python" is a managed environment, often supplied by the OS or some vendor. You don['t want to install directly into that, might break things.
Usually you'd make a venv (a kind of personal python based of th system one) and install in there.
Plain pip install is an older way of oing things, now discouraged.
Got it, thanks! I can’t try that right now, but I will in a while when I’m available.
This help channel has been closed. 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.