Install `Poetry` in Ubuntu
Introduction
Poetry is a tool for dependency management and packaging in Python. It offers a lockfile to ensure repeatable installs, and can build your project for distribution.
Below are the instructions for Ubuntu. Complete instructions list for other methods here: https://python-poetry.org/docs/#installing-with-the-official-installer
Install pyenv
to manage python versions. Here is the complete source
pyenv
to manage python versions. Here is the complete source-
Installing via the recommended way
-
Setup shell environment by adding the commands to the
.bashrc
-
Restart shell
-
(optional) Build environment for
Python
-
Install a python version
-
Set the version
-
Uninstall python version
-
(optional) Update
pyenv
-
(optional) Uninstall
pyenv
: To completely uninstall Pyenv, remove all Pyenv configuration lines from your shell startup configuration, and then remove its root directory. This will delete all Python versions that were installed under the$(pyenv root)/versions/ directory
:
Instructions for poetry
installation
-
Download the Poetry install script and execute
-
Add Poetry to
Path
The installer creates a poetry wrapper in a well-known, platform-specific directory:
$HOME/.local/bin
on Unix.%APPDATA%\Python\Scripts
on Windows.$POETRY_HOME/bin
if $POETRY_HOME is set.
-
Use
Poetry
-
Autocompletion
-
Update
Poetry
(optional) -
Uninstall
Poetry
(optional)
Settings for fish
shell configuration
In the config.fish
file, add the following code snippet to recognize pyenv
and poetry