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

python3.7安装

时间:2020-11-04 17:48:06      阅读:20      评论:0      收藏:0      [点我收藏+]

标签:beat   profile   python   rom   完成   lib   exp   python3安装   font   

安装依赖

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 gcc libffi-devel

 

创建一个目录存放python3安装包,把python.tar包放到此目录下

mkdir /app

解压文件

tar -zxvf Python-3.7.1.tgz

进入目录二进制编译安装

cd Python-3.7.1/

安装目录为/usr/local/python3

./configure --prefix=/usr/local/python3
make
make install

尝试打开python程序

/usr/local/python3/bin/python3.7

退出

>>> exit()
ln -s /usr/local/python3/bin/python3 /usr/bin/python3

ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

vim /etc/profile

最底部添加:
# vim
~/.bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin:/usr/local/python3/bin export PATH

验证:

[root@filebeat python]# pip3 -V

pip 10.0.1 from /usr/local/python3/lib/python3.7/site-packages/pip (python 3.7)

[root@filebeat python]# python3 -V

Python 3.7.1

 

 

完成

 

python3.7安装

标签:beat   profile   python   rom   完成   lib   exp   python3安装   font   

原文地址:https://www.cnblogs.com/dongweizhen/p/13919848.html

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