官网下载
https://www.python.org/downloads/source/
将tar包上传服务器安装
安装基础功能软件
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
解压安装
tar -zxvf Python-3.10.11.tgz
cd Python-3.10.11/
./configure –prefix=/usr/local/python3
make && make install
测试Python3安装
将Python3添加到环境变量中
临时添加环境变量
export PATH=“/usr/local/python3/bin:$PATH”
永久环境变量的添加
echo export PATH=“/usr/local/python3/bin:$PATH” >> ~/.bashrc
python2.X 默认使用ASCII编码
Python3.X 默认使用UTF-8编码
pycharm 安装与使用
pycharm 下载
https://www.jetbrains.com/pycharm/download/#section=linux
tar -zxvf pycharm-community-2023.1.2.tar.gz
cd pycharm-community-2023.1.2/bin
pycharm.sh (关键再次调用,也是开启这个脚本)