Loading video player…

Installing Poetry on Your System

00:00 Before you go ahead to install Poetry in this lesson, let’s clarify what dependency management is. The process of managing all the external libraries or packages your Python projects rely on to function properly.

00:13 As you work with Python, you’ll often need these external packages and ensuring you’re using the right versions across different machines or deployment or development environments is crucial.

00:24 This is where Poetry comes in. Poetry is a tool that aids you in creating Python projects or managing existing ones while handling dependency management for you.

00:34 Poetry takes care of everything from project setup to dependency handling, and it can handle all of this with minimal configurations. And in this lesson, I’ll guide you through installing Poetry on your system so you can start managing your Python dependencies efficiently.

00:50 What are some of the best practices when setting up Poetry? The official documentation strongly advises against installing Poetry directly into your project’s virtual environment.

01:00 Since Poetry relies on several external packages, doing so could result in dependency conflicts causing your code or Poetry itself to malfunction. Instead, it’s best to install Poetry separately, allowing it to act as a standalone application.

01:15 There are a few ways to install Poetry on your machine. One is using the tool pipx. Two, following the official Poetry installer. There are some other methods, like running a manual installation process or using pre-built system packages, but those can be a bit tricky if not done properly. I will highly recommend using pipx for the installation of Poetry.

01:38 pipx is a great tool that creates isolated environments for Python command-line applications. This can help ensure that Poetry runs separately from other packages used in your projects and will help avoid potential conflicts.

01:54 To get started installing pipx, you can check the link to pipx installation in the slide provided in the additional resources. It will also be provided in the description under this video.

02:05 This will provide you with a step-by-step guide on installing pipx tailored to your machine. With it, you can install Poetry from within your terminal with the command pipx install poetry.

02:19 If you prefer not to use pipx, you can also follow the official Poetry installer guide, which is another method to install Poetry. Follow the step-by-step guide shown on the page.

02:35 The link to the official Poetry installer can also be found in the slide in the additional resources section and will also be in the description under this video.

02:47 You can pause the video now and take a moment to try to install pipx and with it Poetry using the pipx install poetry command or explore the official Poetry installer if you do not want to use pipx. Any of these two methods should be fine.

03:02 You can have a look at both of them using their respective links and then decide which is best for you.

03:09 Once you’ve completed installing Poetry, by many of the methods just discussed, next is to confirm that Poetry is installed, and one way to do that is to check what version you have just installed.

03:20 You can do this in a terminal using the poetry --version command. poetry --version.

03:31 You should see the installed version of Poetry displayed in your terminal. It might show something like Poetry (version 1.8.3) as shown in my case. That’s it. You successfully installed Poetry and are ready to manage your project’s dependencies.

03:48 In the next lesson, I’ll show you how to create a new Poetry project.

Become a Member to join the conversation.