CANNOT UNINSTALL DOCUTILS ERROR AFTER RUNNING ./INSTALL.SH COMMAND

Alexis One-Click Anomaly Detection Technical Issue I do not think airflow installs properly when I run ./install.sh. I had to make a couple of tweaks to the install file to get it to work as much as it did

Problem statement:

I do not think airflow installs properly when I run ./install.sh. I had to make a couple of tweaks to the install file to get it to work as much as it did – they include:
    1. I modified the constraints URL since we do not have internet access. I put the output of the constraint in a file (named it “airf”) and referred to it in the install.sh file.
    2. Even though we have Python 3.7 install, the pip3 command could not be found, so I had to hard code the path.

Modified install.sh file:

# airflow needs a home, ~/airflow is the default,

# but you can lay foundation somewhere else if you prefer

# (optional)

export AIRFLOW_HOME=~/airflow

AIRFLOW_VERSION=2.1.0

PYTHON_VERSION="$(python3 --version | cut -d " " -f 2 | cut -d "." -f 1-2)"

# For example: 3.6

# CONSTRAINT_URL= "https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt"

# For example:

# https://raw.githubusercontent.com/apache/airflow/constraints-2.1.2/constraints-3.6.txt

CONSTRAINT_URL=/home/gk-k28346/airf

/usr/local/bin/pip3 install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"

# initialize the database

airflow db init

Error: 

Cannot uninstall docutils. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Solution:

  1. Commands to solve the pip3 not found issue [Reference: python3-pip installed but pip3 command not found? ]:
    1. Steps:
      1. sudo yum  remove python3-pip
      2. sudo yum install python3-pip
      3. pip3 --version
  2. Command to solve the issue in “Cannot uninstall docutils” error [Reference: Python Uninstall a distutils installed project ]:
    1. sudo <directory_path>/pip3 install --ignore-installed docutils 
    2. “OR”
    3. sudo pip3 install --ignore-installed docutils  
  3. Run this command[You can use the same modified install.sh file]: ./install.sh