15

I installed poetry, however I'm getting the following error when attempting to call poetry

zsh: command not found: poetry 

I know I have it installed because I get the following output when trying to run the following install script

$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python                                                                             
Retrieving Poetry metadata                                                                                                                                                                    

Latest version already installed.
arshbot
  • 12,535
  • 14
  • 48
  • 71

3 Answers3

46

The default install location is ~/.poetry/bin/poetry

I added the following to my .zshrc

export PATH="$HOME/.local/bin:$PATH"
Zaffer
  • 1,290
  • 13
  • 32
arshbot
  • 12,535
  • 14
  • 48
  • 71
  • 1
    when I installed it with the cURL call it didn't install it there. If I do `cd $HOME & ls -a` there is no .poetry file :'(. When I do a grep for poetry there are a ton of results at `./Library/Application Support/pypoetry`. Any idea why that is or how to fix it? Thanks! – sbru Oct 06 '21 at 07:05
  • i would inspect the file that is executed by the curl command, there's likely a clue as to where it was placed – arshbot Oct 06 '21 at 18:10
  • 7
    The new location is `~/.local/bin/poetry`, so it should be `export PATH="$HOME/.local/bin:$PATH"` – Patrick Yan Sep 09 '22 at 01:50
  • This answer is out of date, follow @PatrickYan 's update above – gemart Feb 02 '23 at 16:02
  • updated to take poetry version 1.3 into account – Zaffer Feb 25 '23 at 20:00
  • @Zaffer a moderator has previously rejected an edit very similar to yours, and yours has just been rejected. In the future, you may _add_ information to a post to keep it up to date, but you should not remove or edit any information in a way that conflicts with the author's original intent. Please see https://stackoverflow.com/help/editing for more information. – Hack5 Feb 27 '23 at 16:49
10

Initially I wanted to run poetry within a condo environment. After running

pip install poetry

I saw it was installed using my local Python and not linked to a conda environment. In my case I added

export PATH="$HOME/.local/bin:$PATH"

to the end of the .zshrc file under my home directory.

Tip: You can use CMD+Shift+. for MacOS to view your hidden files and folders :)

upe
  • 1,862
  • 1
  • 19
  • 33
Chr Ninja
  • 127
  • 1
  • 4
7

Update for the new version of the official poetry installer:

curl -sSL https://install.python-poetry.org | python3 -

This version will install in your default python3 bin. For example: $HOME/Library/Python/3.9/bin, the installer will print out the location to your shell.

Add

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

to ~/.profile or ~/.zprofile.

it's-yer-boy-chet
  • 1,917
  • 2
  • 12
  • 21