查看当前的python版本 python --version python3 --version 装git yum update -y && yum install git -y apt update -y && apt install git -y apk update && apk add git 下载pyenv管理 curl https://pyenv.run | bash 编辑变量文件 nano ~/.bashrc 添加pyenv的变量 export PYENV_ROOT="$HOME/.pyenv" if [[ -d "$PYENV_ROOT/bin" ]]; then export PATH="$PYENV_ROOT/bin:$PATH" fi eval "$(pyenv init --path)" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" 重新加载bashrc source ~/.bashrc 查看pyenv的版本 pyenv --version 安装依赖 # CentOS yum groupinstall "Development Tools" -y yum install openssl-devel bzip2-devel libffi-devel ncurses-devel zlib-devel readline-devel sqlite-devel xz-devel findutils -y curl -O https://www.openssl.org/source/openssl-1.1.1u.tar.gz tar -xzf openssl-1.1.1u.tar.gz cd openssl-1.1.1u ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl shared zlib make make install echo "/usr/local/openssl/lib" ...