I was trying to install a library using flit.

The correct command is flit install.

Flit is a simple way to package and publish Python packages on PyPI. You can read up about it in the docs.

They also have a “Why use Flit” section.