python - Airflow 安装问题 SyntaxError : Missing parentheses in call to 'print'

标签 python linux ubuntu airflow

我试图在 Ubuntu 上安装 Airflow 。
我用 python 3.5.3 设置了一个 virtualenv 并尝试以这种方式安装 Airflow :

pip install -U pip setuptools wheel \
    && pip install Cython \
    && pip install pytz \
    && pip install pyOpenSSL \
    && pip install ndg-httpsclient \
    && pip install pyasn1 \
    && pip install python-crontab \
    && pip install crontabs \
    && pip install py4j==0.10.7\
    && pip install thrift-sasl==0.2.1\
    && pip install git+https://github.com/tobes/snakebite.git@python-3-long \
    && pip install apache-airflow[crypto,devel_hadoop,mysql]==1.10.9 \
    && pip install werkzeug==0.16.1
但我有这个错误
Using cached protobuf-2.5.0.tar.gz (68 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/arslane/airflow/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cnsf0k86/protobuf_49e7336cd75a470cbb1c2c76bfa70896/setup.py'"'"'; __file__='"'"'/tmp/pip-install-cnsf0k86/protobuf_49e7336cd75a470cbb1c2c76bfa70896/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 /tmp/pip-pip-egg-info-jd672mun
         cwd: /tmp/pip-install-cnsf0k86/protobuf_49e7336cd75a470cbb1c2c76bfa70896/
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-cnsf0k86/protobuf_49e7336cd75a470cbb1c2c76bfa70896/setup.py", line 52
        print "Generating %s..." % output
                               ^
    SyntaxError: Missing parentheses in call to 'print'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
任何人都可以帮我解决这个问题吗?

最佳答案

使用以下内容,即 https://github.com/apache/airflow/blob/constraints-1.10.9/constraints-3.5.txt (Airflow 1.10.9 和 Python 3.5 的约束文件):

pip install -U 'pip<20.3' setuptools wheel \
    && pip install Cython \
    && pip install pytz \
    && pip install pyOpenSSL \
    && pip install ndg-httpsclient \
    && pip install pyasn1 \
    && pip install python-crontab \
    && pip install crontabs \
    && pip install py4j==0.10.7\
    && pip install thrift-sasl==0.2.1\
    && pip install git+https://github.com/tobes/snakebite.git@python-3-long \
    && pip install protobuf==3.11.3
    && pip install apache-airflow[crypto,devel_hadoop,mysql]==1.10.9 -c https://github.com/apache/airflow/blob/constraints-1.10.9/constraints-3.5.txt \
    && pip install werkzeug==0.16.1
我认为您看到的错误是由于旧版本的 Protobuf

关于python - Airflow 安装问题 SyntaxError : Missing parentheses in call to 'print' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65089903/

相关文章:

windows - Mod_rewrite 在 Windows 和 Ubuntu 上有不同的结果

python - setup.py 在 chroot 中清理期间挂起

python - 使用 Python read() 图像文件并将其发送到 HttpResponse

c++ -/usr/include/x86_64-linux-gnu/bits/string_fortified.h :106:10: error: ‘__builtin_strncpy’

linux - 如何正确杀死 child_process ?

c - 关于Linux C-UUID

ubuntu - 使用鱿鱼代理进行基本身份验证

python - 字符串比较 : Actual newline is never recognized as "\n"

python - 我正在用 Python 编写 Roguelike 程序,并且需要一个特定的怪物跟随脚本

c - 转储内核模块堆栈