下载Python
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz
解压
tar -xvf Python-3.6.3.tar.zx
进入到解压后的文件夹
cd Python-3.6.3
./configure --prefix='Your Install Director'
make && make install
添加路径,编辑
~/.bashrc
vim ~/.bashrc
在文件最后添加
export PATH=/Your Install Path:$PATH
,如export PATH=/usr/local/bin/:$PATH
创建别名,编辑
~/.bashrc
vim ~/.bashrc
在文件最后添加
alias python='Your python path'
alias pip='Your pip path'