0

我想通过 Happybase 将 Pyspark 与 Hbase 连接起来。但我在开始时收到此错误:

(pyenv) hduser@master:~$ python -c 'import happybase'
(pyenv) hduser@master:~$ python -c connection = happybase.Connection("somehost") bash: 意外标记 `(' 附近的语法错误

4

1 回答 1

0

首先,连接命令中存在语法错误。其次,如果您想在后续步骤中使用 happybase 库,您必须按照以下方式将整个脚本从 bash 运行到单个命令中,以便维护会话。

 python -c "import happybase;connection = happybase.Connection('localhost')"

另一种选择是创建一个 python.py文件并从 bash 运行它。

于 2018-12-14T10:11:53.320 回答