Python
Centos 7
Centos7 自带 Python2 版本和 PIP2,所以我们只要直接安装 Python3即可:
bash
代码语言:txt复制# 搜索可用的Python3版本
yum search python3
# 安装Python3.6版本
yum install python36
# 查看Python版本
python3 -V
Python 3.6.8
# 查看pip版本
pip3 -V
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)
# 升级pip版本
pip install --upgrade pip
pip3 install --upgrade pip
# 安装ipython
pip install ipython
pip3 install ipython
安装pyenv
pyenv 是 Python多版本管理神器,安装起来也很简单:
bash
代码语言:txt复制# 安装基础依赖
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel -y
# 下载pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
# 配置pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
zsh