#๐Ÿ”’ PIP

71 messages ยท Page 1 of 1 (latest)

outer smeltBOT
#

@spare cargo

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.

spare cargo
zenith niche
#

pip should just ship with any modern Python. get-pip was a transition tool for earlier Pythons.

spare cargo
#

last time i did it (about a few months to a year back) i had to manually install pip

zenith niche
#

If you invoke Python as python, run: python -m pip help

Adjust python to suit.

clever mortar
#

!dashmpip

outer smeltBOT
#
Install packages with `python -m pip`

When trying to install a package via pip, it's recommended to invoke pip as a module: python -m pip install your_package.

Why would we use python -m pip instead of pip?
Invoking pip as a module ensures you know which pip you're using. This is helpful if you have multiple Python versions. You always know which Python version you're installing packages to.

Note
The exact python command you invoke can vary. It may be python3 or py, ensure it's correct for your system.

spare cargo
spare cargo
zenith niche
#

Yeah. Back out to your command line prompt.

spare cargo
zenith niche
#

Get a windows command prompt instead.

spare cargo
zenith niche
# spare cargo

Yes. You're at the Python interactive prompt. You want cmd.exe or Power Shell to run python -m pip.

#

On Windows it's spelled py -m pip.

spare cargo
#

uhh

#

when i ran on windows command prompt

#

it gave a very long thing

zenith niche
#

Can you show a screenshot of py -m pip help at the windows command prompt?

zenith niche
#

Excellent.

zenith niche
#

Usually you need pip in order to install something.

#

... so did you need to install something specific?

spare cargo
zenith niche
#

Ok. pip is installed, you're good there.

spare cargo
#

i was supposed to run $ pip install -U discord.py

#

in shell

#

but when i did i got error invalid syntax

zenith niche
#

Right. This is better spelled:

python -m pip install -U discord
#

Do that.

spare cargo
#

same error

zenith niche
#

Show the error pls/

spare cargo
zenith niche
#

The $ prompt, BTW, is something I associate with a UNIX shell.

#

Ah! You're back in the Python prompt. Go back to the command prompt.

zenith niche
#

... and that $ you typed is in fact a prompt from the example. Leave it out.

spare cargo
#

sry it said to do the command in shell

zenith niche
#

Yes. In UNIX, that means the command line environment. Not the Python interactive prompt.

#

You want the Windows command line.

spare cargo
#

i think i should re do my harvard course TvT

zenith niche
#

"TvT" ?

spare cargo
#

like ๐Ÿ˜ญ this

zenith niche
#

Get back to your Windows command prompt, the one with C:\users\idkla>. At that prompt, type python -m pip install -U discord

zenith niche
#

Huzzah!

spare cargo
zenith niche
#

So python is a command. It has to happen at the windows command prompt. The >>> prompt is Python's interactive prompt, it expect Python syntax.

zenith niche
#

To verify, get back to the Python prompt and type import discord.

#

It should succeed (silently).

spare cargo
zenith niche
#

import discord is a Python statement. Type it at the >>> prompt.

spare cargo
#

yeah it imported

zenith niche
#

Well I was in fact being literal.

#

Yay!

#

So the discord package is installed. You should be able to proceed now.

Sounds like their tutorial/guide is using UNIX nomenclature. So: "shell" means the Windows command prompt.

zenith niche
#

Good luck. I need to go AFK.

spare cargo
# zenith niche Good luck. I need to go AFK.

and im back again because im so confused about this error

Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    client = discord.Client()
TypeError: Client.__init__() missing 1 required keyword-only argument: 'intents'```
#

hmmm

outer smeltBOT
#
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.

#

๐Ÿ”’ PIP