python -m pip <package> ERROR: unknown command <package>

I'm trying to run a package I installed with pip from command line. (this one, not that it matters)

I try to run a package with either:

python -m pip yawsso
ERROR: unknown command "yawsso"

or just calling it in the command line:

> yawsso
zsh: command not found: yawsso

I then check to see if it's installed properly, and it is


> pip list
Package          Version
---------------- -------
pip              21.2.4
(...)
yawsso           0.7.1
> pip install yawsso
Requirement already satisfied: yawsso in /Users/<user>/Library/Python/3.9/lib/python/site-packages (0.7.1)

What's going on?

EDIT: As I mentioned. I have already tried installing it and it says the requirement is met:

> python -m pip install yawsso
Requirement already satisfied: yawsso in /Users/federico.esteban/Library/Python/3.9/lib/python/site-packages (0.7.1)

Solution 1:

Dont leave out install , the correct command is python -m pip install yawsso

Solution 2:

For Modern macos/OSX, you need to find your ~/Library/Python/$version/bin directory and add it to your $PATH.

I added this line to my .zshrc

export PATH=$HOME/Library/Python/3.9/bin:$PATH

After this my yawsso is working correctly.