Reputation: 21
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
+ CategoryInfo : ObjectNotFound: (poetry:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
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
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