MacOS 安装 Airflow 1.10.7
一、下载 Airflow 1.10.7 源码
- GitHub 仓库 https://github.com/apache/airflow
- 1.10.7 源码 https://github.com/apache/airflow/archive/1.10.7.zip
- python 版本 3.7
二、解压
三、安装 cython 以及 freetds
cython 没安装会遇到如下错误:
Collecting pymssql==2.1.4
Downloading pymssql-2.1.4.tar.gz (691 kB)
|████████████████████████████████| 691 kB 12.6 MB/s
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python@3.7/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-1coze0wm/pymssql/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-1coze0wm/pymssql/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-install-1coze0wm/pymssql/pip-egg-info
cwd: /private/tmp/pip-install-1coze0wm/pymssql/
Complete output (7 lines):
/usr/local/lib/python3.7/site-packages/setuptools/dist.py:43: DistDeprecationWarning: Do not call this function
warnings.warn("Do not call this function", DistDeprecationWarning)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-install-1coze0wm/pymssql/setup.py", line 88, in <module>
from Cython.Distutils import build_ext as _build_ext
ModuleNotFoundError: No module named 'Cython'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
freetds 没安装会遇到如下错误:
Collecting pymssql==2.1.4
Downloading pymssql-2.1.4.tar.gz (691 kB)
|████████████████████████████████| 691 kB 387 kB/s
Building wheels for collected packages: pymssql
Building wheel for pymssql (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python@3.7/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-60668yo6/pymssql/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-60668yo6/pymssql/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/tmp/pip-wheel-7p6ao6uq
cwd: /private/tmp/pip-install-60668yo6/pymssql/
Complete output (40 lines):
/usr/local/lib/python3.7/site-packages/setuptools/dist.py:43: DistDeprecationWarning: Do not call this function
warnings.warn("Do not call this function", DistDeprecationWarning)
setup.py: platform.system() => 'Darwin'
setup.py: platform.architecture() => ('64bit', '')
setup.py: platform.libc_ver() => ('', '')
setup.py: Detected Darwin/Mac OS X.
You can install FreeTDS with Homebrew or MacPorts, or by downloading
and compiling it yourself.
Homebrew (http://brew.sh/)
--------------------------
brew install freetds
MacPorts (http://www.macports.org/)
-----------------------------------
sudo port install freetds
setup.py: Not using bundled FreeTDS
setup.py: include_dirs = ['/usr/local/include']
setup.py: library_dirs = ['/usr/local/lib']
running bdist_wheel
running build
running build_ext
cythoning src/_mssql.pyx to src/_mssql.c
/usr/local/lib/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /private/tmp/pip-install-60668yo6/pymssql/src/_mssql.pxd
tree = Parsing.p_module(s, pxd, full_module_name)
warning: src/_mssql.pyx:150:4: Exception already a builtin Cython type
cythoning src/pymssql.pyx to src/pymssql.c
/usr/local/lib/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /private/tmp/pip-install-60668yo6/pymssql/src/pymssql.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building '_mssql' extension
creating build
creating build/temp.macosx-10.15-x86_64-3.7
creating build/temp.macosx-10.15-x86_64-3.7/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python@3.7/3.7.8_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/_mssql.c -o build/temp.macosx-10.15-x86_64-3.7/src/_mssql.o -DMSDBLIB
src/_mssql.c:611:10: fatal error: 'sqlfront.h' file not found
#include "sqlfront.h"
^~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pymssql
四、安装依赖
sudo pip3.7 install -r https://raw.githubusercontent.com/apache/airflow/constraints-1.10.7/constraints-3.7.txt
五、安装 Apache-airflow
进入到刚刚解压的源码目录
sudo python3.7 setup.py install