#๐ How to use pip?
38 messages ยท Page 1 of 1 (latest)
@abstract iron
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.
What command exactly are you running?
pip install pygame
And on what OS are you? (Windows I assume?)
win11^^
Try: py -m pip install pygame
File "<python-input-4>", line 1
py -m pip install pygame
^^^
SyntaxError: invalid syntax
Ah
I thought i had to run the command on the Python app
I did just get an error though
No. The REPL is just a dumb line-by-line Python code interpreter. It "can't do" system commands
Got it o7
should i send every line for this?
it states note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
ร Getting requirements to build wheel did not run successfully.
โ exit code: 1
โฐโ> See above for output.
What command did you run exactly?
Let me try it out myself
This is the output I get:
(.venv) PS C:\Users\samur\PycharmProjects\PythonProject1> py -m pip install pygame
Collecting pygame
Obtaining dependency information for pygame from https://files.pythonhosted.org/packages/7e/11/17f7f319ca91824b86557e9303e3b7a71991ef17fd45286bf47d7f0a38e6/pygame-2.6.1-cp313-cp313-win_amd64.whl.metadata
Downloading pygame-2.6.1-cp313-cp313-win_amd64.whl.metadata (13 kB)
Downloading pygame-2.6.1-cp313-cp313-win_amd64.whl (10.6 MB)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ 10.6/10.6 MB 25.5 MB/s eta 0:00:00
Installing collected packages: pygame
Successfully installed pygame-2.6.1
[notice] A new release of pip is available: 23.2.1 -> 25.2
[notice] To update, run: python.exe -m pip install --upgrade pip
(.venv) PS C:\Users\samur\PycharmProjects\PythonProject1>
What did you get?
a massive mess of lines, not at all what you get
a little more precise please?
Click here to see this code in our pastebin.
You did start/activate your venv, didn't you?
I have no idea what that is o_o
We just started covering python and I was meaning to install it now
What IDE are you using?
I downloaded vscode but all we've done so far is porting over things from Pyret to Python, not at all began messing with venv
I really wish i could specify more
Should i install venv?
Hmm. I think the by far easiest way for you would be to go with PyCharm: https://www.jetbrains.com/pycharm/. It's a very powerful IDE and - at least I'd assume it - the status quo for Python development. The advantage for you as a beginner is that it takes care of all those venv (virtual environment) related things, as well as actually running the code.
If you insist on using VS Code there's a series of commands you'll need:
These steps you'll need to do once per project:
cdinto your project's directorypy -m venv .venvto create the virtual environment for this project in a folder.venv(.is a prefix for hidden files)
These steps you need to repeat every time you open the project:.\.venv\Scripts\activatepy -m pip installs as required
I'll download PyCharm then, how would I go around with pytest and pygame?
You write the import statement, hover over it, and click the install button. Doesn't get much simpler than that:
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.