centOS7 安装python3.6.5 与 pyCharm搭建pyspark开发环境
Linux版本:centos7.4
一、安装python3
先安装Python3的依赖包
yum install epel-release yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
安装几个必须的包,以方便后续的操作
yum install wget gcc make
上 Python的官网 下载源码包,存放在压缩包目录(自定义)下
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
cd到压缩包目录下,解压出来
tar -zxvf Python-3.6.5.tgz
新建python3文件夹,作为安装路径
mkdir /usr/local/python3 或 mkdir /home/hadoop/app/python3
在解压出来的Python-3.6.5进行编译,编译到安装路径,并执行安装
./configure --prefix=/home/hadoop/app/python3 make && make install
--prefix:安装路径
修改软连接
ln -s /home/hadoop/app/python3/bin/python3 /usr/bin/python3 ln -s /home/hadoop/app/python3/bin/pip3 /usr/bin/pip3
查看安装版本
python3 -v
pip3 -v
二、安装pyCharm
登录官网jetbrains.com
cd本地的默认Downloads目录下,并解压
tar -zxvf pycharm-community-2020.1.5.tar.gz -C /home/hadoop/app/
安装
cd /home/hadoop/app/pycharm-community-2020.1.5
cd bin/
./pycharm.sh
创建软连接,在终端直接执行pycharm就能启动
ln -s /home/hadoop/app/pycharm-community-2020.1.5/bin/pycharm.sh /usr/bin/pycharm
三、搭建spark开发环境
初步测试一下
搭建spark开发环境
变量:PYTHONPATH 变量值:Spark安装路径下的python
PYTHONPATH
/home/hadoop/app/spark-2.3.0-bin-2.6.0-cdh5.15.1/python
变量:SPARK_HOME 变量值:Spark安装路径
SPARK_HOME
/home/hadoop/app/spark-2.3.0-bin-2.6.0-cdh5.15.1
设置项目结构project structure
-----------------------------------------------------转载需备注博主名和原创网址!!!------------------------------------------------------