#!/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