- Airflow install on windows
- Install Apache Airflow locally
- Install Apache Airflow on server
- Install Apache Airflow on cluster
- Install Apache Airflow to contribute
- Install Apache Airflow by Cloud
- Installation¶
- Prerequisites¶
- Installation tools¶
- Airflow extra dependencies¶
- Provider packages¶
- Differences between extras and providers¶
- System dependencies¶
- Constraints files¶
- Installation script¶
- Python versions support¶
- Set up a database¶
- Troubleshooting¶
- Airflow command is not recognized¶
- Symbol not found: _Py_GetArgcArgv В¶
- Airflow install on windows
- Ответы (5)
Airflow install on windows
Remember that Apache Airflow is a platform created by the Community and you can join us!
Install Apache Airflow locally
When installing locally is a good option for you?
- If you don’t want to do it by yourself
- If you don’t want to do it by yourself
- If you don’t want to do it by yourself
- If you don’t want to do it by yourself
Install Apache Airflow on server
When installing locally is a good option for you?
- If you don’t want to do it by yourself
- If you don’t want to do it by yourself
- If you don’t want to do it by yourself
- If you don’t want to do it by yourself
Install Apache Airflow on cluster
When installing locally is a good option for you?
- If you don’t want to do it by yourself
- If you don’t want to do it by yourself
- If you don’t want to do it by yourself
- If you don’t want to do it by yourself
Install Apache Airflow to contribute
When installing locally is a good option for you?
- If you don’t want to do it by yourself
- If you don’t want to do it by yourself
- If you don’t want to do it by yourself
- If you don’t want to do it by yourself
Install Apache Airflow by Cloud
When installing locally is a good option for you?
Installation¶
This page describes installations using the apache-airflow package published in PyPI, but some information may be useful during installation with other tools as well.
Airflow is also distributed as a Docker image (OCI Image). For more information, see: Production Container Images
Prerequisites¶
Airflow is tested with:
Python: 3.6, 3.7, 3.8
PostgreSQL: 9.6, 10, 11, 12, 13
Kubernetes: 1.16.9, 1.17.5, 1.18.6
Note: MySQL 5.x versions are unable to or have limitations with running multiple schedulers – please see: Scheduler . MariaDB is not tested/recommended.
Note: SQLite is used in Airflow tests. Do not use it in production. We recommend using the latest stable version of SQLite for local development.
Please note that with respect to Python 3 support, Airflow 2.0.0 has been tested with Python 3.6, 3.7, and 3.8, but does not yet support Python 3.9.
Installation tools¶
The official way of installing Airflow is with the pip tool. There was a recent (November 2020) change in resolver, so currently only 20.2.4 version is officially supported, although you might have a success with 20.3.3+ version (to be confirmed if all initial issues from pip 20.3.0 release have been fixed in 20.3.3). In order to install Airflow you need to either downgrade pip to version 20.2.4 pip install —upgrade pip==20.2.4 or, in case you use Pip 20.3, you need to add option —use-deprecated legacy-resolver to your pip install command.
While they are some successes with using other tools like poetry or pip-tools, they do not share the same workflow as pip — especially when it comes to constraint vs. requirements management. Installing via Poetry or pip-tools is not currently supported. If you wish to install airflow using those tools you should use the constraint files and convert them to appropriate format and workflow that your tool requires.
Airflow extra dependencies¶
The apache-airflow PyPI basic package only installs what’s needed to get started. Additional packages can be installed depending on what will be useful in your environment. For instance, if you don’t need connectivity with Postgres, you won’t have to go through the trouble of installing the postgres-devel yum package, or whatever equivalent applies on the distribution you are using.
Most of the extra dependencies are linked to a corresponding providers package. For example “amazon” extra has a corresponding apache-airflow-providers-amazon providers package to be installed. When you install Airflow with such extras, the necessary provider packages are installed automatically (latest versions from PyPI for those packages). However you can freely upgrade and install provider packages independently from the main Airflow installation.
For the list of the extras and what they enable, see: Reference for package extras .
Provider packages¶
Unlike Apache Airflow 1.10, the Airflow 2.0 is delivered in multiple, separate, but connected packages. The core of Airflow scheduling system is delivered as apache-airflow package and there are around 60 providers packages which can be installed separately as so called Airflow Provider packages . The default Airflow installation doesn’t have many integrations and you have to install them yourself.
You can even develop and install your own providers for Airflow. For more information, see: Provider packages
For the list of the provider packages and what they enable, see: Providers packages reference .
Differences between extras and providers¶
Just to prevent confusion of extras versus provider packages: Extras and providers are different things, though many extras are leading to installing providers.
Extras are standard Python setuptools feature that allows to add additional set of dependencies as optional features to “core” Apache Airflow. One of the type of such optional features are providers packages, but not all optional features of Apache Airflow have corresponding providers.
We are using the extras setuptools features to also install provider packages. Most of the extras are also linked (same name) with provider packages — for example adding [google] extra also adds apache-airflow-providers-google as dependency. However there are some extras that do not install providers (examples github_enterprise , kerberos , async — they add some extra dependencies which are needed for those extra features of Airflow mentioned. The three examples above add respectively github enterprise oauth authentication, kerberos integration or asynchronous workers for gunicorn. None of those have providers, they are just extending Apache Airflow “core” package with new functionalities.
System dependencies¶
You need certain system level requirements in order to install Airflow. Those are requirements that are known to be needed for Linux system (Tested on Ubuntu Buster LTS) :
You also need database client packages (Postgres or MySQL) if you want to use those databases.
Constraints files¶
Airflow installation might be sometimes tricky because Airflow is a bit of both a library and application. Libraries usually keep their dependencies open and applications usually pin them, but we should do neither and both at the same time. We decided to keep our dependencies as open as possible (in setup.cfg and setup.py ) so users can install different version of libraries if needed. This means that from time to time plain pip install apache-airflow will not work or will produce unusable Airflow installation.
In order to have repeatable installation, starting from Airflow 1.10.10 and updated in Airflow 1.10.13 we also keep a set of “known-to-be-working” constraint files in the constraints-master , constraints-2-0 and constraints-1-10 orphan branches and then we create tag for each released version e.g. constraints-2.0.1 . This way, when we keep a tested and working set of dependencies.
Those “known-to-be-working” constraints are per major/minor python version. You can use them as constraint files when installing Airflow from PyPI. Note that you have to specify correct Airflow version and python versions in the URL.
You can create the URL to the file substituting the variables in the template below.
AIRFLOW_VERSION — Airflow version (e.g. 2.0.1 ) or master , 2-0 , 1-10 for latest development version
PYTHON_VERSION Python version e.g. 3.8 , 3.7
Installation script¶
In order to simplify the installation, we have prepared a script that will select the constraints file compatible with your Python version
Plain installation:
If you don’t need to install any extra extra, you can use the command set below:
Installing with extras
If you need to install extra dependencies of airflow , you can use the script below (the example below installs postgres and google extras.
Python versions support¶
As of Airflow 2.0 we agreed to certain rules we follow for Python support. They are based on the official release schedule of Python, nicely summarized in the Python Developer’s Guide
We end support for Python versions when they reach EOL (For Python 3.6 it means that we will stop supporting it on 23.12.2021).
The “oldest” supported version of Python is the default one. “Default” is only meaningful in terms of “smoke tests” in CI PRs which are run using this default version.
We support a new version of Python after it is officially released, as soon as we manage to make it works in our CI pipeline (which might not be immediate) and release a new version of Airflow (non-Patch version) based on this CI set-up.
Set up a database¶
Airflow requires a database. If you’re just experimenting and learning Airflow, you can stick with the default SQLite option. If you don’t want to use SQLite, then take a look at Set up a Database Backend to setup a different database.
Troubleshooting¶
This section describes how to troubleshoot installation issues.
Airflow command is not recognized¶
If the airflow command is not getting recognized (can happen on Windows when using WSL), then ensure that
/.local/bin is in your PATH environment variable, and add it in if necessary:
You can also start airflow with python -m airflow
Symbol not found: _Py_GetArgcArgv В¶
If you see Symbol not found: _Py_GetArgcArgv while starting or importing Airflow, this may mean that you are using an incompatible version of Python. For a homebrew installed version of Python, this is generally caused by using Python in /usr/local/opt/bin rather than the Frameworks installation (e.g. for python 3.7 : /usr/local/opt/python@3.7/Frameworks/Python.framework/Versions/3.7 ).
The crux of the issue is that a library Airflow depends on, setproctitle , uses a non-public Python API which is not available from the standard installation /usr/local/opt/ (which symlinks to a path under /usr/local/Cellar ).
An easy fix is just to ensure you use a version of Python that has a dylib of the Python library available. For example:
Alternatively, you can download and install Python directly from the Python website.
Airflow install on windows
17530 просмотра
5 ответа
Обычные инструкции по запуску Airflow не применяются в среде Windows:
Утилита Airflow недоступна в командной строке, и я не могу найти ее в другом месте, чтобы добавить ее вручную. Как Airflow может работать в Windows?
Ответы (5)
1 плюс
Вы можете активировать bash в Windows и следовать учебнику, как есть. Я был в состоянии встать и бежать успешно после вышеупомянутого.
Как только вы закончите установку, отредактируйте, airflow.cfg чтобы указать все ваши конфигурации где-нибудь в вашей системе Windows, а не на lxss (ubuntu), так как в Ubuntu есть ошибки, не показывающие файлы, записанные системой Windows.
10 плюса
Вместо того, чтобы устанавливать Airflow через pip, загрузите zip на GitHub проекта Airflow , разархивируйте его и в его папке запустите python setup.py install из командной строки. ERROR — ‘module’ object has no attribute ‘SIGALRM’ ошибки будут, но пока это не повлияло на функции Airflow.
При использовании этого метода утилита воздушного потока не будет доступна в качестве команды. В качестве обходного пути используйте [current folder]\build\scripts-2.7\airflow файл, который является скриптом python для утилиты airflow.
Другое решение состоит в добавлении к переменной System PATH ссылки на командный файл, который запускает airflow (airflow.bat):
С этого момента, учебник может следовать обычно:
Я не проверял, насколько хорошо или DAG Airflow работают на Windows.
Автор: Rafael Размещён: 03.09.2015 02:30
6 плюса
К сожалению, по состоянию на декабрь 2015 года ответом на этот вопрос является «Нет» — см. Https://github.com/airbnb/airflow/issues/709 . Это из-за переезда в оружейный. gunicorn может получить поддержку windows в R18 .
6 плюса
Три основных варианта
Я прошел несколько итераций этой проблемы и задокументировал их по мере продвижения. Я попробовал три вещи:
- Установите Airflow непосредственно в Windows 10 — эта попытка не удалась.
- Установите Airflow в Windows 10 WSL с Ubuntu — Это сработало отлично. Обратите внимание, что WSL — это подсистема Windows для Linux, которую вы можете бесплатно получить в магазине Windows.
- Установите Airflow в Windows 10 через Docker + Centos — Это также отлично работало.
Обратите внимание, что если вы хотите, чтобы он работал как служба Linux, это невозможно для варианта № 2. Это возможно для варианта № 3, но я этого не сделал, так как он требует активации привилегированных контейнеров в Docker (который я хочу не знаю, когда я начал). Кроме того, запуск службы в Docker является своего рода противоречием парадигме, поскольку каждый контейнер в любом случае должен быть отдельным процессом / единицей ответственности.
Подробное описание # 2 — опция WSL
Если вы гонг за вариант 2, основные шаги:
- Получить WSL Ubuntu установлен и открыт.
- Убедитесь, что он поставляется с Python 3.6.5 или около того («python3 -version»).
- Предполагая, что это все еще происходит, добавьте эти пакеты, чтобы установка PIP не помешала.
- sudo apt-get установить software-properties-common
- sudo apt-add-repository Universe
- sudo apt-get update
- Установите пункт с:
- sudo apt-get установить python-pip
- Выполните следующие 2 команды для установки воздушного потока:
- export SLUGIFY_USES_TEXT_UNIDECODE = да
- pip install apache-airflow
- Откройте новый терминал (я был удивлен, но это казалось обязательным).
- Инициируйте БД воздушного потока:
- поток воздуха initdb
После этого вам должно быть хорошо идти! В блоге есть более подробная информация о многих из этих шагов и примерных сроках того, сколько времени займет установка WSL и т. Д., Поэтому, если вам будет трудно погрузиться в это еще немного.
1 плюс
Вы можете сделать это с помощью Cygwin . Cygwin — это оболочка командной строки, которая работает в Windows и эмулирует Linux. Таким образом, вы сможете запускать команды,
Примечание 1: Если вы используете Cygwin на компьютере, поставляемом компанией, вам может потребоваться запустить приложение Cygwin от имени администратора. Вы можете сделать это с помощью следующего руководства от Microsoft .
Примечание 2: Если, как и я, вы находитесь за прокси-сервером (на работе или вне зависимости от того, за каким прокси вы находитесь), вам нужно установить две переменные окружения, чтобы pip работал в командной строке; в этом случае Cygwin. Вы можете следовать этому ответу StackOverflow для более подробной информации. Поэтому я установил следующие две переменные окружения на моем компьютере с Windows,
Больше не работает: видимо, все вышеперечисленные работы были напрасны, потому что Airflow не будет работать в Windows. Пожалуйста, смотрите этот пост StackOverflow . Вышеуказанные шаги позволят вам использовать Pip.
В качестве альтернативы , и я знаю, что это может или не может рассматриваться как запуск в Windows, вы можете установить клиент виртуальной машины, такой как Oracle Virtualbox или VMware Workstation, и затем установить любую версию Linux, такую как Ubuntu Desktop, и затем вы можете запустить Linux обычно. Если вам нужны более подробные шаги, чтобы сделать это, вы можете следовать этому AskUbuntu из ответа сообщества Stack Exchange здесь .
В качестве альтернативы (2) , вы можете создать учетную запись AWS , затем настроить простой экземпляр ec2 под управлением Linux , затем ssh в этот экземпляр ec2 и затем выполнить все свои команды для своего сердца. AWS предлагает бесплатный уровень, так что вы сможете сделать это бесплатно. Кроме того, AWS очень хорошо документирован, поэтому не составит труда установить и запустить простой сервер Linux; Я предполагаю, что новичок мог бы быть сделан с этим приблизительно через час.