Real
Real

Reputation: 21

Windows: Poetry isn't recognized and commands aren't working although it has already been installed properly

poetry : The term 'poetry' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

I tried with the poetry documentation to install again and it says that the latest version is installed. But whenever I try running commands like poetry shell, poetry install, etc. it gives me an error.

Upvotes: 2

Views: 5410

Answers (1)

Pado
Pado

Reputation: 49

I had a similar problem recently. When doing the windows installation, Poetry has installed its 'poetry.exe' within "AppData\Roaming\Python\Scripts" which was not my python folder !

So, I move this 'poetry.exe' into the correct one "\AppData\Local\Programs\Python\Python311\Scripts" and it worked.

Hope that helps,

EDIT:

A proper and more pragmatic solution (inspired by https://stackoverflow.com/a/76086485/5763115). In powershell (or cmd):

run sysdm.cpl, click on the Advanced tab, button Environment Variables...

and add the path = "%appdata%\Python\Scripts" in the variable Path.

It worked for me.

Upvotes: 1

Related Questions