Python安装

方法一:

1.安装python-2.7.6.amd64.msi(安装在D:\Program Files\Python\python27\下)

numpy-MKL-1.8.0.win-amd64-py2.7.exe

matplotlib-1.3.1.win-amd64-py2.7.exe

2.配置python环境变量

控制面板-高级系统设置-环境变量-系统变量-Path里添加“D:\Program Files\Python\python27\”

3.在D:\Program Files\Python\下按快捷键“shift+ctrl+右键”打开“命令窗口”:输入“ez_setup.py”,setuptools安装完成后“D:\Program Files\Python\python27\Scripts"内容发生变化。

4.配置setuptools环境变量

控制面板-高级系统设置-环境变量-系统变量-Path里添加“D:\Program Files\Python\python27\Scripts\”

5.使用easy_install安装scikit-learn

在开始菜单里搜索”cmd“打开命令行窗口,输入”easy_install scikit-learn“,直到”Finish...“则安装完成。

方法二:

1.安装:Anaconda2-4.0.0-Windows-x86_64.exe。http://www.continuum.io/downloads

2.conda参考文档:http://conda.pydata.org/docs/ 

  • conda list  :   输入 conda list 来看一下所有安装时自带的Python扩展。粗略看了一下,其中包括了常用的 Numpy , Scipy , matplotlib 和 networkx 等,以及beautiful-soup , requests , flask , tornado 等网络相关的扩展
  • conda install 要安装的python包 :  安装指定的python包
  • conda创建虚拟环境:

    科学计算环境的另一个要求就是能够多个Python版本并存,尤其是2.x和3.x的并存。这个通过 virtualenv 可以做到。Anaconda也正是通过其实现的。

    下面用conda创建一个名叫python2的版本为python2.7的环境。

    conda create -n test python=3.4.3 anaconda

    这样就会在Anaconda安装目录下的envs目录下创建test这个目录,且该环境将包含指定的anaconda中包含的全部的包,如果环境名后面不加其他的包名,则默认只包含基本的python模块。

    向其中安装扩展可以:直接用 conda install 并用 -n 指明安装到的环境,这里自然就是 test。

    怎样在IDE中使用创建出来的环境?如果是PyCharm等IDE,直接设置Python安装目录就可以了。

  • conda的repo中的扩展不算太新,如果想要更新的,可能要用PyPI或者自己下载源码。而conda和pip关联的很好。使用pip安装的东西可以使用conda来管理,这点要比Canopy好。

3.打开 IPython qtconsole:打开cmd-->C:\Users\lenovo>,输入python -m jupyter qtconsole(注:python -m可省去)

   打开jupyter notebook:打开cmd-->C:\Users\lenovo>,输入jupyter notebook

   打开spyder:打开cmd-->C:\Users\lenovo>,输入spyder

4.spyder快捷键:ctrl+1注释,ctrl+4块注释blockcomment Ctrl+4
断点       breakpoint                       F12
关闭所有 close all                           Ctrl+Shift+W
代码补全 code completion               Ctrl+Space
条件断点 conditional breakpoint       Shift+F12
配置       configure                         F6
复制行    copy line                          Ctrl+Alt+Down
调试       debug                             Ctrl+F5

             debug with winpdb          F7

转向定义 go to definition                 Ctrl+G

            go to line                          Ctrl+L
            go to next file                   Ctrl+Shift+Tab
            go to previous file              Ctrl+Tab

运行      run profiler                        F10
            run analysis                       F8

            run                                     F5
            run selection                      F9

            re-run last script              Ctrl+F6

删除行   delte line                         Ctrl+D
寻找      find next                         F3
            fine previous                  Shift+F3
            find text                         Ctrl+F

注释     toggle comment             Ctrl+1
           unblockcomment            Ctrl+4

恢复     redo                                Ctrl+Y

撤销     undo                               Ctrl+U

上次编辑位置last edit location     Ctrl+Alt+Shift+Left

替换文本 replace text                  Ctrl+H 
对文件file操作:

save all                           Ctrl+Alt+S

save as                           Ctrl+Alt+S

save file                           Ctrl+S 

new file                           Ctrl+N

open file                          Ctrl+O

对文件doucument操作:

start of document           Ctrl+Up

end of document             Ctrl+Down

对line操作:

move line down              Alt+Down
move line up                   Alt+Up

duplicate line                  Ctrl+Alt+Up

show/hide outline           Ctrl+Alt+O

对光标位置操作:
previous cursor position  Ctrl+ALT+Left
next cursor position        Ctrl+Alt+Right  

对project操作:

inspect current object Ctrl+I

show/hide project explorer Ctrl+Alt+P


            

            
           

           



posted @ 2016-04-01 14:48  hudongni1  阅读(595)  评论(0编辑  收藏  举报