标签:环境变量 bsp 出现 read Opens sqlite ftp 环境 org
wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
首先我们要先下载Python3的所有依赖包,否则安装安装完后会出现各种问题
yum install gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel -y
tar -xvf Python-3.7.1.tgz
mkdir /usr/local/python3
cd Python-3.7.1
./configure --prefix=/usr/local/python3
make && make install
/usr/local/python3/bin/python3 -V
1 编辑环境变量配置文件
vim /etc/profile
2 在文件的最后一行添加配置
PATH=/usr/local/python3/bin:$PATH
# 这个/usr/local/python3/就是刚才安装的路径
3 !wq保存退出
4 让PATH立即生效
source /etc/profile
补充:
也可以通过建立一个软链达到环境变量的效果
ln -s /usr/local/python3/bin/python3 /bin/python3
标签:环境变量 bsp 出现 read Opens sqlite ftp 环境 org
原文地址:https://www.cnblogs.com/sunch/p/10012092.html