Skip to content

Installation & Initilization

Installing Poetry

If you're working on an existing Poetry project, you can take a look at its poetry.lock file and find the version of Poetry it is using. Then, the only local pip installation you'll have to do is for Poetry itself with that version. For example, if its version is 1.5.1, as is the case with most CHIME SPS GitHub Organization repositories:

pip install poetry==1.5.1
However, the recommended way, albeit more complicated, to install Poetry is to use the install-poetry.py script. This will isolate Poetry from the rest of your system. Run the following command to install Poetry:
curl -sSL https://install.python-poetry.org | python3 -

Adding Poetry to PATH

Sometimes, the location where Poetry is installed isn't on your operating system's PATH variable, so trying to run Poetry commands after installing it will bring up errors. Try running the following to add it to your path first:

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

Initializing Poetry

If you already have an existing project folder, but it is currently not using Poetry, you can setup Poetry with it using:

poetry init
This will start an interactive process in your terminal, which is failry straightforward to follow. Do not worry if you make any mistakes, as your responses can be changed later in Poetry's configuration files.

Alternatively, if you want to make a whole new project/folder with Poetry, you can run:

poetry new {desired_name_of_project}