气流安装问题语法错误:调用“print”时缺少括号

2024-10-02 12:32:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图在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.

有谁能帮我提一下吗


Tags: installpippygitinfooutputeggsetup
1条回答
网友
1楼 · 发布于 2024-10-02 12:32:46

使用以下文件,即https://github.com/apache/airflow/blob/constraints-1.10.9/constraints-3.5.txt(气流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的旧版本

相关问题 更多 >

    热门问题