vscode配置conda环境

写在最前面

之前一直是jupyter notebook+pycharm
帮朋友配置环境的时候发现:vscode结合了cell+自动补齐,狠狠心动了
于是安装+配置vscode

参考:
https://blog.csdn.net/fan18317517352/article/details/123035625
https://zhuanlan.zhihu.com/p/263036716
https://zhuanlan.zhihu.com/p/378378346
https://blog.csdn.net/qq_51831335/article/details/126757014

安装

vscode

直接百度,然后在官网下载windows版本即可
在这里插入图片描述
一路同意即可
尽量不要安装在系统C盘,我的安装路径为:D:\program\Microsoft VS Code

anaconda3

在清华源直接下载
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=M&O=A
选择win64版本
在这里插入图片描述

一路同意即可
尽量不要安装在系统C盘,我的安装路径为:D:\program\anaconda3

然后进行环境配置
在这里插入图片描述
在这里插入图片描述
python的环境变量也一起配置了,我的是
C:\Users\Yu\AppData\Roaming\Python\Python311\Scripts

测试:
进入cmd

conda --version

在这里插入图片描述

conda info -e

在这里插入图片描述
ok了

配置conda国内镜像

参考:https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
Windows 用户无法直接创建名为 .condarc 的文件,可先执行

conda config --set show_channel_urls yes

在C:\Users\你的用户名目录下会生成.condarc文件,生成该文件之后再修改。、在这里插入图片描述
将配置文件复制到复制到.condarc 文件

channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  deepmodeling: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/

在这里插入图片描述
测试

# 清除索引缓存
conda clean -i

conda create -n name

在这里插入图片描述

安装ipykernel

conda install ipykernel

vscode中文

点击“应用”按钮
输入“Chinese (Simplified) Language Pack for Visual Studio Code
在这里插入图片描述
ok了
在这里插入图片描述

vscode配置anaconda环境步骤

安装Python软件和jupyter扩展(没有图,记得自己安装)
在这里插入图片描述

打开项目文件

选择anconda中的环境
注意:只有安装了python插件才会有这个界面

在Vscode中使用CTRL+P,另外部分系统是:CTRL+Shift+P的快捷键打开搜索,然后输入:

select interpreter

在这里插入图片描述
点击小齿轮
在这里插入图片描述
OK啦

新建.ipynb项目

在这里插入图片描述
在这里插入图片描述

完美撒花✿✿ヽ(°▽°)ノ✿

猜你喜欢

转载自blog.csdn.net/wtyuong/article/details/132775180