python3.7安装
2021-03-20 18:27
标签:beat profile python rom 完成 lib exp python3安装 font 安装依赖 创建一个目录存放python3安装包,把python.tar包放到此目录下 解压文件 进入目录二进制编译安装 安装目录为/usr/local/python3 尝试打开python程序 验证: 完成 python3.7安装 标签:beat profile python rom 完成 lib exp python3安装 font 原文地址:https://www.cnblogs.com/dongweizhen/p/13919848.htmlyum -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
mkdir /app
tar -zxvf Python-3.7.1.tgz
cd Python-3.7.1/
./configure --prefix=/usr/local/python3
make
make install
/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