Anaconda与jupyter安装配置与使用
1、anaconda安装
进入官网下载:
1 进去之后选择与自己电脑版本相匹配的版本下载,比如我的电脑是win10/64位
点击之后下载,下载完成后打开所在文件夹:
右键,管理员身份运行:
点击finish之后会跳出下面的网页,叉掉就可以了
2、jupyter安装配置
右键,选择管理员运行:
运行后显示如下界面,并点击:
点击后会自动跳转到jupyter:
3、使用jupyter
通过cmd检查Python的版本是否是3.8,出入exit()退出:
查看版本:
在jupyter创建项目进行测试:
然后进入如下界面:
点击Untitle1对项目进行重命名:
然后就可以输代码,写完点击运行就可以啦:
注释方法:
按ESC—>按大写字母M—>输入注释内容—>点运行:
也可以通过#进行注释:
4、快捷键
Enter : 转入编辑模式
Shift-Enter : 运行本单元,选中下个单元
Ctrl-Enter : 运行本单元
Alt-Enter : 运行本单元,在其下插入新单元
Y : 单元转入代码状态
M :单元转入markdown状态
R : 单元转入raw状态
Tab : 代码补全或缩进
Shift-Tab : 提示
Ctrl-] : 缩进
Ctrl-[ : 解除缩进
Ctrl-A : 全选
Ctrl-Z : 复原
Esc : 进入命令模式
Ctrl-M : 进入命令模式
5、添加镜像源
没配置前先查看一下:
conda config --get channels
删除之前的镜像源回复默认:
conda config --remove-key channels
添加清华的镜像源,依次执行命令
#添加镜像源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
#显示检索路径
conda config --set show_channel_urls yes
#显示镜像通道
conda config --show channels
执行完显示如下就成功啦
6、模块的安装与卸载
安装卸载都需要在pip前面加 ! 号
比如安装numy模块
!pip install numpy
7、anaconda的卸载
由于我之前安装过anaconda,所以我是先卸载后再重新下载的
右键anaconda快捷方式,选择打开文件所在位置,双击Uninstall-Anaconda3.exe
8、总结
anaconda 是一个python的发行版,包括了python和很多常见的软件库, 和一个包管理器conda,对于初学者还是很友好的,使用起来方便简单。anaconda的安装也比较简单的,大家如果哪一步出现了问题可以发表在评论区呀。