Python library commands not working

for example: pipx install “something”
when i run it in the command bar, it dosent recognise “pipx”. why so?

Where is pipx installed? Is it installed?

pipx does not come with Python by default, it is a separate tool. Did you mean pip?

pip does work, but not pipx.
here have this:
Requirement already satisfied: pipx in c:\users\1\appdata\roaming\python\python312\site-packages (1.4.3)
Requirement already satisfied: argcomplete>=1.9.4 in c:\users\1\appdata\roaming\python\python312\site-packages (from pipx) (3.2.2)
Requirement already satisfied: colorama>=0.4.4 in c:\users\1\appdata\roaming\python\python312\site-packages (from pipx) (0.4.6)
Requirement already satisfied: packaging>=20 in c:\users\1\appdata\roaming\python\python312\site-packages (from pipx) (23.2)
Requirement already satisfied: platformdirs>=2.1 in c:\users\1\appdata\roaming\python\python312\site-packages (from pipx) (4.2.0)
Requirement already satisfied: userpath!=1.9.0,>=1.6 in c:\users\1\appdata\roaming\python\python312\site-packages (from pipx) (1.9.1)
Requirement already satisfied: click in c:\users\1\appdata\roaming\python\python312\site-packages (from userpath!=1.9.0,>=1.6->pipx) (8.1.7)

This sounds like an issue for a pipx support forum, not the Python Packaging discussion.

Unfortunately I can’t point you in the right direction, as I’m not a pipx user. And when you do find the right place, make sure you show what you typed and what error you get. It’s all but impossible to help you without that info.

I would ordinarily agree, but I’m pretty sure this is an instance of a perennial Windows issue that affects many Python packages in the same way.


OP:

What happens if you try running

c:\users\1\appdata\roaming\python\python312\Scripts\pipx

? If that works, then here is my diagnosis.

When you install a Python package that includes its own “commands” runnable from the command line, those programs have to go somewhere. Pip doesn’t put them in your system-wide Program Files, nor a user-specific install directory such as %LocalAppData%\Programs. Instead, they go into the Scripts subdirectory of the Python installation.

If you installed Python in the recommended way - without checking the option to add it to the PATH, to avoid polluting PATH and to let py do its job without interference - then that Scripts folder would also not get added to the PATH. Therefore, Windows can’t find the program.

Pipx uses a project.scripts entry in its pyproject.toml to describe this “entry point”. When Pip installs Pipx on Windows, it will (unless Hatch somehow overrides this) create an actual executable pipx.exe program in the Scripts subdirectory. That isn’t a Python source file (or compiled code, zipapp etc.), it’s a standalone - so py can’t help you launch it.

This is kinda just one of those Windows things. I strongly recommend using virtual environments anyway. If you install Pipx into a Python 3.12 virtual environment, as long as the virtual environment is active, the pipx.exe should be safely on the PATH.