Python 3.6 安装pip install gearman 报错

Python 3.6 Error when installing pip install gearman

我一直在尝试在 python 3.6 上安装 gearman,但出现此错误:

$ pip install gearman
Collecting gearman
  Using cached gearman-2.0.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-xmf1cqe7/gearman/setup.py", line 5, in <module>
        from gearman import __version__ as version
      File "/tmp/pip-build-xmf1cqe7/gearman/gearman/__init__.py", line 7, in <module>
        from gearman.admin_client import GearmanAdminClient
      File "/tmp/pip-build-xmf1cqe7/gearman/gearman/admin_client.py", line 4, in <module>
        from gearman import util
      File "/tmp/pip-build-xmf1cqe7/gearman/gearman/util.py", line 62
        except select_lib.error, exc:
                               ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-xmf1cqe7/gearman/

我正在使用 Ubuntu 16.04 LTS

pip -V -> pip 9.0.1 来自 [my_project_folder]/venv/lib/python3.6/site-packages (python 3.6)

python --version -> Python 3.6.2

我该如何解决?

gearman包不支持Python3.只支持python2.4-2.7根据他们setup.py. There is an open pull request添加python3支持不过已经一年未动。我相信Yelp!可能已经停止支持这个库。

您使用 python3 并在 python3 改为使用:raise 语法不再接受以逗号分隔的参数。 gearman不是Python3版本,可以查看linkhttps://pypi.python.org/pypi/gearman