0

我在带有 RHEL 的 CDH 5.12 上有一个带有 Spark 2.2 的集群,我正在尝试设置 IPython 以与 pyspark2 一起使用。我已经安装了 IPython 5.x LTS(长期支持),但我无法让它工作。

至今

yum -y update
yum install epel-release
yum -y install python-pip
yum groupinstall 'Development Tools'
yum install python-devel

pip install IPython==5.0 --user

但我无法让它工作。有人知道我错过了什么吗?

4

1 回答 1

1

pyspark 启动脚本寻找,

# Determine the Python executable to use for the driver:
if [[ -n "$IPYTHON_OPTS" || "$IPYTHON" == "1" ]]; then
  # If IPython options are specified, assume user wants to run IPython
  # (for backwards-compatibility)
  PYSPARK_DRIVER_PYTHON_OPTS="$PYSPARK_DRIVER_PYTHON_OPTS $IPYTHON_OPTS"
  PYSPARK_DRIVER_PYTHON="ipython"
elif [[ -z "$PYSPARK_DRIVER_PYTHON" ]]; then
  PYSPARK_DRIVER_PYTHON="${PYSPARK_PYTHON:-"$DEFAULT_PYTHON"}"
fi

在您的以下变量中设置~/.bashrc

echo "export PATH=$PATH:/path_to_downloaded_spark/spark-1.6.0/bin"
echo "export PYSPARK_DRIVER_PYTHON=ipython"
echo "export PYSPARK_DRIVER_PYTHON_OPTS='notebook'
于 2017-10-30T17:33:48.293 回答