sh 在CentOS上安装Python3.4和SciPy堆栈https://edwards.sdsu.edu/research/installing-python3-4-and-the-scipy-s
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 在CentOS上安装Python3.4和SciPy堆栈https://edwards.sdsu.edu/research/installing-python3-4-and-the-scipy-s相关的知识,希望对你有一定的参考价值。
#!/bin/bash
yum groupinstall -y "Development tools" || exit $?
yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel || exit $?
echo '/usr/local/lib' >> /etc/ld.so.conf || exit $?
ldconfig || exit $?
# INSTALL PYTHON 2.7
cd /usr/local/src || exit $?
wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz || exit $?
tar xvf Python-2.7.6.tar.xz || exit $?
cd Python-2.7.6 || exit $?
./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib" || exit $?
make || exit $?
make altinstall || exit $?
# INSTALL PYTHON 3.4
cd /usr/local/src || exit $?
wget http://python.org/ftp/python/3.4.1/Python-3.4.1.tar.xz || exit $?
tar xvf Python-3.4.1.tar.xz || exit $?
cd Python-3.4.1 || exit $?
./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib" || exit $?
make || exit $?
make altinstall || exit $?
# INSTALL NUMPY/SCIPY
yum install -y lapack lapack-devel blas blas-devel || exit $?
/usr/local/bin/pip3.4 install numpy || exit $?
/usr/local/bin/pip3.4 install scipy || exit $?
# INSTALL MATPLOTLIB (1/3)
cd /usr/local/src || exit $?
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz || exit $?
tar xvzf freetype-2.5.3.tar.gz || exit $?
cd freetype-2.5.3 || exit $?
./configure || exit $?
make || exit $?
make install || exit $?
# INSTALL MATPLOTLIB (2/3)
if ! ( rpm -q libpng-devel ); then
cd /usr/local/src || exit $?
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/libpng-devel-1.2.49-1.el6_2.x86_64.rpm || exit $?
rpm -Uvh libpng-devel-1.2.49-1.el6_2.x86_64.rpm || exit $?
fi
# INSTALL MATPLOTLIB (3/3)
cd /usr/local/src || exit $?
git clone https://github.com/matplotlib/matplotlib.git || exit $?
cd matplotlib/ || exit $?
/usr/local/bin/python3.4 setup.py build || exit $?
/usr/local/bin/python3.4 setup.py install || exit $?
# INSTALL virtualenv
/usr/local/bin/pip3.4 install virtualenv || exit $?
以上是关于sh 在CentOS上安装Python3.4和SciPy堆栈https://edwards.sdsu.edu/research/installing-python3-4-and-the-scipy-s的主要内容,如果未能解决你的问题,请参考以下文章
如何在Centos上安装python3.4
如何在CentOS6上安装Python2.7和Python3.3
在centos上配置python3.4环境(哎,痛苦的一天啊!)
如何在CentOS6上安装Python2.7和Python3.3
CentOS 6.5安装python3.3.4
centos6安装python3.4和pip3