Removing Dependencies
00:00
If you want to remove one or more dependencies from your project, Poetry provides the poetry remove
command. For example, say you wanted to remove the isort
library we just added by typing poetry remove isort
.
00:17
For the group dependency, you should see the dependency removed. In your terminal, you should see Removing isort
. The same goes for a main dependency.
00:27
For example, running poetry remove requests
will remove that main dependency.
00:36
The remove command works for any installed dependency. In your terminal, you’ll find that Poetry removes the requests
dependencies along with its sub-dependencies, so you don’t need to worry about leftover packages that are no longer needed by your project.
00:52
And if you want to see all the dependencies left in your project, the poetry show
can be run at any time to show the state of your dependencies. In your terminal, run poetry show
.
01:05
This will show you all the installed packages in your project. For a more detailed view, showing you sub-dependencies, you can add the --tree
flag.
01:15
For example, poetry show --tree
.
01:22 This will show you a detailed list of your project’s dependencies and any sub-dependencies they rely on. In the next lesson, I’ll show you how to update, lock, and synchronize dependencies.
Become a Member to join the conversation.