###window下->###
安装anaconda(最新版都可以)->创建py27的虚拟环境->激活py27环境->在此环境下安装anaconda(配置好镜像源)、numpy(这个好像安装好py27就有了)、scipy、matplotlib、scikit-learn、pandas缺什么补什么。
镜像源配置:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
conda config --remove channels defaults
添加虚拟环境:
python2.7 conda create -n py27 python=2.7
conda config --show #可以看到channels等信息
activate py27 #会在命令行路径前出现py27,进入了py27环境
conda install -n py27 anaconda #把python27的anoconda默认的包都装上
(在anaconda3的安装路径中会找到envs文件夹,里面会有py27的文件,添加虚拟环境python2.7只是在此环境下安装了python2.7,因此需要把anaconda默认的包都装上,后面运行程序少什么安装什么)
此时,在py27环境下输入命令:jupyter notebook
退出jupyter:ctrl + c
退出py27环境:deactivate
安装scikit-learn包:
使用pip pip install -U scikit-learn
或conda conda install scikit-learn
Scikit-learn库需要一些其他库的支持,如下:
Python (>= 2.6 or >= 3.3)
NumPy (>= 1.6.1)
SciPy (>= 0.9)
###linux下(本人使用的是基于debian的deeping系统) ###
自带python2.7
使用pip安装包、或者sudo apt-get
sudo pip install numpy #安装numpy
sudo apt-get install python-matplotlib python-pandas #安装matplotlib、pandas
sudo pip install scipy #安装scipy
sudo pip install -U scikit-learn #安装scikit-learn
pip list #查看邮件安装的所有文件