Red Hat Enterprise Linux 8版本安装python3.7的shell脚本

#!/bin/sh
yum update -y 
yum groupinstall base fonts -y 
yum install sqlite-devel -y
yum install libffi* openssl* pcre* zlib* -y
yum -y install gcc automake autoconf libtool make 
yum install gcc gcc-c++ -y

wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz 
tar xzf Python-3.7.1.tgz 
cd Python-3.7.1 

./configure --prefix=/usr/local/python37 
make && make install 
rm -rf /usr/bin/python3
ln -s /usr/local/python37/bin/* /bin/
ln -s /usr/local/python37/bin/python3  /usr/bin/python3

因为我需要安装jupyter,所以服务器版本安装jupyter+python3的脚本在下面

#!/bin/sh
yum update -y 
yum groupinstall base fonts -y 
yum install sqlite-devel -y
yum install libffi* openssl* pcre* zlib* -y
yum -y install gcc automake autoconf libtool make 
yum install gcc gcc-c++ -y

wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz 
tar xzf Python-3.7.1.tgz 
cd Python-3.7.1 

./configure --prefix=/usr/local/python37 
make && make install 
rm -rf /usr/bin/python3
ln -s /usr/local/python37/bin/* /bin/
ln -s /usr/local/python37/bin/python3  /usr/bin/python3


pip3 install jupyter 
pip3 install 
mkdir /home/project/


/usr/local/python37/bin/jupyter  notebook --generate-config 
echo "c.NotebookApp.ip = '0.0.0.0'" >> /root/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.allow_root = True"   >> /root/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.open_browser = False" >> /root/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.port = 9000"  >> /root/.jupyter/jupyter_notebook_config.py
echo "c.ContentsManager.root_dir = '/home/project'"  >> /root/.jupyter/jupyter_notebook_config.py


# /usr/local/python37/bin/jupyter notebook password
# nohup  /usr/local/python37/bin/jupyter notebook  &


# aws configure
发布了67 篇原创文章 · 获赞 36 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/qq_41861526/article/details/95663817