作者:Liu_y_菁 | 来源:互联网 | 2023-05-26 18:04
centos7已经自带python2.7.5,这里需要安装python3第一步:安装依赖包yum-ygroupinstallDevelopmenttoolsyum-yins
centos7已经自带python2.7.5,这里需要安装python3
第一步:安装依赖包
yum -y groupinstall "Development tools"
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
第二步:下载python3,这里下载3.6.2
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
第三步:指定存放目录(/usr/local/python3就是python3的安装目录)
mkdir /usr/local/python3
第四步:解压压缩包,进入该目录
tar -xvJf Python-3.6.2.tar.xz
cd Python-3.6.2
./configure --prefix=/usr/local/python3
(注:./configure --prefix=/usr/local/python3这句的作用就是将程序安装在/usr/local/python3这个目录下)
第五步:安装python3
make && make install
(注:make是编译,make install是安装)
第六步:创建软链接(将 /usr/bin/python3指向/usr/local/python3/bin/python3)
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
升级pip(如果需要)
按照提示升级pip,命令:pip3 install --upgrade pip
2.安装其它(直接输入命令)
pip3 install numpy
pip3 install scipy
pip3 install matplotlib
pip3 install pandas
pip3 install statsmodels
pip3 install scikit-learn
pip3 install theano
pip3 install tensorflow
pip3 install keras
pip3 install gensim