alembic command not found

In this troubleshooting guide we learn how to fix alembic command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

alembic: command not found

or when using sudo you get the following error message

sudo: alembic: command not found

Solutions to alembic: command not found

How To Fix alembic: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu alembic is provided by alembic package.

alembic is:

Alembic is a new database migration tool, written by the author of SQLAlchemy. A migration tool offers the following functionality:

  • Can emit ALTER statements to a database in order to change the structure of tables and other constructs
  • Provides a system whereby “migration scripts” may be constructed; each script indicates a particular series of steps that can “upgrade” a target database to a new version, and optionally a series of steps that can “downgrade” similarly, doing the same steps in reverse.
  • Allows the scripts to execute in some sequential manner.

This package provides /usr/bin/alembic script and documentation for Alembic, and depends on the python3-alembic package which contains all the actual code (in Python 3) for Alembic to actually work.

To fix this problem, we can install more using the command below.

sudo apt-get -y install alembic

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install alembic.

sudo apt -y install alembic

Or if you have aptitude installed you can use the following command.

sudo aptitude install alembic

Summary

In this tutorial we learn how to fix alembic command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.