码迷,mamicode.com
首页 > 编程语言 > 详细

Centos7安装python3、numpy、scipy、matplotlib、pandas等

时间:2020-07-29 10:26:45      阅读:82      评论:0      收藏:0      [点我收藏+]

标签:logs   mil   inux   tool   panda   nload   back   evel   压缩   

centos 7 已经自带 python 2.7.15,这里需要安装 python 3

[root@pwm]# python
Python 2.7.15 |Anaconda, Inc.| (default, Dec 14 2018, 19:04:19)
[GCC 7.3.0] on linux2

第一步:安装依赖包

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

 

第二步:下载python 3,这里下载 3.8.5

https://www.python.org/downloads/source/

wget https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tar.xz

 

第三步:指定存放目录(/usr/local/python3就是python3的安装目录)

mkdir /usr/local/python3

 

第四步:解压压缩包,进入该目录

tar -xvJf  Python-3.8.5.tar.xz
cd Python-3.8.5
./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

 

使用:

/usr/local/python3/bin/python3

 

 

2.安装其它(直接输入命令)

pip3 install numpy

pip3 install scipy

pip3 install matplotlib

pip3 install pandas

pip3 install statsmodels

pip3 install scikit-learn

pip3 install gensim

pip3 install theano

pip3 install keras

pip3 install tensorflow

 

 

REF

https://www.cnblogs.com/zhangtingzu/p/8650664.html

Centos7安装python3、numpy、scipy、matplotlib、pandas等

标签:logs   mil   inux   tool   panda   nload   back   evel   压缩   

原文地址:https://www.cnblogs.com/emanlee/p/13395022.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!