ubuntu14.04环境搭建——python、R

python

ubuntu系统默认是python2.7
sudo apt-get install python-pip
修改pip的源(默认源下载太慢)
sudo vim ~/.pip/pip.conf 添加

trusted-host=mirrors.aliyun.com
index-url=http://mirrors.aliyun.com/pypi/simple/```

sudo apt-get install python-numpy
sudo apt-get install python-scipy
sudo apt-get install python-matplotlib
sudo apt-get install python-sklearn
sudo pip install pandas

sudo apt-get install ipython

sudo pip install notebook

sudo apt-get install ipython-notebook

##R安装
###安装最新版本
sudo vim /etc/apt/sources.list    添加以下信息:
deb [http://mirror.bjtu.edu.cn/cran/bin/linux/ubuntu](http://mirror.bjtu.edu.cn/cran/bin/linux/ubuntu) trusty/            
deb [http://mirror.neu.edu.cn/ubuntu/](http://mirror.neu.edu.cn/ubuntu/) trusty-backports main restricted universe
sudo apt-get update 

###如果遇到错误:
Reading package lists... Done
W: GPG error: http://mirror.bjtu.edu.cn trusty/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9
输入: 
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 51716619E084DAB9
###安装R与开发工具
sudo apt-get upgrade  
sudo apt-get install r-base
sudo apt-get install gdebi-core
>开发工具推荐Rstudio
sudo gdebi rstudio-0.99.484-amd64.deb
>R包换国内的源tools-->global option-->package 换成国内的源

你可能感兴趣的:(ubuntu14.04环境搭建——python、R)