[英]Error while Happybase connection with hbase, how I define my host
I want to connect Pyspark with Hbase by Happybase. 我想通过Happybase将Pyspark与Hbase连接起来。 But I get this error at the beginnig:
但我在beginnig时收到此错误:
(pyenv) hduser@master:~$ python -c 'import happybase'
(pyenv)hduser @ master:〜$ python -c'导入happybase'
(pyenv) hduser@master:~$ python -c connection = happybase.Connection("somehost") bash: syntax error near unexpected token `('(pyenv)hduser @ master:〜$ python -c connection = happybase.Connection(“ somehost”)bash:意外令牌'('附近的语法错误
First there is a syntax error in connection command. 首先,连接命令中存在语法错误。 Secondly if you want to use the happybase library in subsequent steps, you have to run the entire script into single command from the bash in following way so that the session will be maintained.
其次,如果要在后续步骤中使用happybase库,则必须按照以下方式从bash将整个脚本运行到单个命令中,以便维护会话。
python -c "import happybase;connection = happybase.Connection('localhost')"
Another option is create a python .py
file and run that from the bash. 另一个选择是创建一个python
.py
文件,然后从bash运行该文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.