Janaki
Janaki

Reputation: 145

Running Airflow on Ubuntu 20.04 (TypeError: required field "type_ignores" missing from Module```)

I am new to the airflow. I installed airflow in my ubuntu machine. Below is my environment details. Ubuntu 20.04 LTS Python 3.8 pip 20.0.2 airflow 1.10.10

I can able to initialize airflow DB by issuing airflow initdb command. But, when I trying to start a server using airflow webserver -p 8080, I am getting below error. Any help would be appreciable.

I runned the command in the superuser(su) mode.

    root@SKR-PC:/home/skr# sudo airflow webserver -p 8080
  ____________       _____________
 ____    |__( )_________  __/__  /________      __
____  /| |_  /__  ___/_  /_ __  /_  __ \_ | /| / /
___  ___ |  / _  /   _  __/ _  / / /_/ /_ |/ |/ /
 _/_/  |_/_/  /_/    /_/    /_/  \____/____/|__/
Traceback (most recent call last):
  File "/usr/local/bin/airflow", line 37, in <module>
    args.func(args)
  File "/usr/local/lib/python3.8/dist-packages/airflow/utils/cli.py", line 75, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/airflow/bin/cli.py", line 900, in webserver
    app = cached_app_rbac(None) if settings.RBAC else cached_app(None)
  File "/usr/local/lib/python3.8/dist-packages/airflow/www/app.py", line 232, in cached_app
    app = create_app(config, testing)
  File "/usr/local/lib/python3.8/dist-packages/airflow/www/app.py", line 47, in create_app
    app = Flask(__name__)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 601, in __init__
    self.add_url_rule(
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 98, in wrapper_func
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1278, in add_url_rule
    self.url_map.add(rule)
  File "/usr/local/lib/python3.8/dist-packages/werkzeug/routing.py", line 1388, in add
    rule.bind(self)
  File "/usr/local/lib/python3.8/dist-packages/werkzeug/routing.py", line 730, in bind
    self.compile()
  File "/usr/local/lib/python3.8/dist-packages/werkzeug/routing.py", line 794, in compile
    self._build = self._compile_builder(False).__get__(self, None)
  File "/usr/local/lib/python3.8/dist-packages/werkzeug/routing.py", line 951, in _compile_builder
    code = compile(module, "<werkzeug routing>", "exec")
TypeError: required field "type_ignores" missing from Module```

Upvotes: 0

Views: 2629

Answers (1)

SergiyKolesnikov
SergiyKolesnikov

Reputation: 7815

The latest Python version supported by Airflow 1.10.10 is 3.7 [1], but Ubuntu 20.04 comes with Python 3.8.

To install Airflow on Ubuntu 20.04:

  1. Install Python 3.7:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.7 libpython3.7-dev
  1. Create a virtual environment and instal Airflow in it:
sudo apt install pipenv
mkdir my_airflow
cd my_airflow
pipenv --python 3.7 install apache-airflow
  1. Init the Airflow's database backend form the virtual environment:
pipenv shell
airflow initdb

After the installation, to run any airflow command, activate the virtual environment and run the command:

cd my_airflow
pipenv shell
airflow any_airflow_command

Upvotes: 2

Related Questions