按照以下步骤装,就行了!
apt-get install libncurses5-dev libncursesw5-dev libreadline6-dev -y
apt-get install libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev -y
apt-get install libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev -y
wget http://mirrors.sohu.com/python/3.5.1/Python-3.5.1.tgz
tar xzvf Python-3.5.1.tgz
cd Python-3.5.1
./configure --prefix=/usr/local/python35
make all
make install
vim ~/.bashrc
$ sudo rm /usr/bin/python /usr/bin/python2
$ sudo ln -s /usr/local/python35/bin/python3.5 /usr/bin/python
$ sudo ln -s /usr/local/python35/bin/pip3 /usr/bin/pip
pip3 install --upgrade pip
pip3 install numpy
pip3 install pandas
apt-get update
apt-get install build-essential -yapt-get install libncurses5-dev libncursesw5-dev libreadline6-dev -y
apt-get install libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev -y
apt-get install libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev -y
wget http://mirrors.sohu.com/python/3.5.1/Python-3.5.1.tgz
tar xzvf Python-3.5.1.tgz
cd Python-3.5.1
./configure --prefix=/usr/local/python35
make all
make install
vim ~/.bashrc
在最后一行添加export PATH=$PATH:/usr/local/python35/bin
保存后source ~/.bashrc
输入 python3
,可以看到现在的版本是3.5.1。
$ sudo rm /usr/bin/python /usr/bin/python2
$ sudo ln -s /usr/local/python35/bin/python3.5 /usr/bin/python
$ sudo ln -s /usr/local/python35/bin/pip3 /usr/bin/pip
pip3 install --upgrade pip
pip3 install numpy
pip3 install pandas