search
HomeDevelopment ToolsVSCodeWhat is the connection between vscode and anaconda

What is the connection between vscode and anaconda

Dec 16, 2019 pm 05:13 PM
anacondavscodeconnect

What is the connection between vscode and anaconda

Anaconda是非常好用的开源python发行版本,自带了一堆python常用库,有Windows,MacOS,Linux版本,是非常棒的管理python的工具。

VSCode是一款免费开源的现代化轻量级代码编辑器,支持几乎所有主流的开发语言的语法高亮、智能代码补全、自定义热键、括号匹配、代码片段、代码对比 Diff、GIT 等特性,支持插件扩展,并针对网页开发和云端应用开发做了优化。

软件跨平台支持 Win、Mac 以及 Linux。

工作中常使用Anaconda+VSCode来搭建python环境。

我使用的都是Windows版本,Win10操作系统

1、安装Anaconda

下载安装包,安装到指定路径(最好不是C盘),点next下去就装完了,中途会提示你装VS Code,装就是了。

装完后运行cmd:conda --version,看看是否装好了,再运行 conda activate就进入anaconda环境。

What is the connection between vscode and anaconda

conda activate等效于直接点Anaconda Prompt快捷方式。

2、创建Anaconda的Python子环境

Anaconda的Python子环境都在安装路径anaconda3\envs里面,先输入conda create -n test python=3.6.6,创建一个3.6.6python子环境

What is the connection between vscode and anaconda

输入y,就ok了。

同理,你可以创建python2.7,python3.7,各种子环境任你玩耍,可以通过conda或者pip安装各种包。

3、Anaconda的Python子环境切换

创建好之后,可以通过activate test,激活子环境,然后通过deactivate,退出子环境

What is the connection between vscode and anaconda

4、VSCode python路径指定

打开VSCode,看看是不是有这几个插件:

What is the connection between vscode and anaconda

然后在File---->Preferences---->Settings里面,选择Extensions----->Python Configuration,如图:

What is the connection between vscode and anaconda

然后点Edit in settings.json把原本的python路径修改为你需要的子环境python路径即可。

"python.pythonPath": "D:\\Anaconda3\\envs\\test\\python.exe"

相关文章教程推荐:vscode教程

The above is the detailed content of What is the connection between vscode and anaconda. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Can vscode run in LinuxCan vscode run in LinuxApr 15, 2025 pm 06:12 PM

Of course, VS Code can run smoothly in Linux. Just prepare your Linux system, install the necessary dependencies, and easily install VS Code through the package manager to start and use.

How to solve the problem of renaming folders by vscodeHow to solve the problem of renaming folders by vscodeApr 15, 2025 pm 06:09 PM

Reasons for VS Code to be unable to rename folders may include file occupancy, insufficient permissions, extension conflicts, and file system errors. The solutions are: close the occupancy process, obtain administrator permissions, disable conflict extensions, and check for file system errors.

How to solve the problem of not finding python module in vscodeHow to solve the problem of not finding python module in vscodeApr 15, 2025 pm 06:06 PM

The reason why VS Code cannot find the Python module may be: the Python interpreter is configured incorrectly and the correct interpreter needs to be manually selected. Missing a virtual environment, you can create a standalone Python environment using venv or conda. The environment variable PYTHONPATH does not contain the module installation path and needs to be added manually. Module installation errors, you can use pip list to check and reinstall the missing module. For code path issues, you need to carefully check the usage of relative and absolute paths.

What to do if vscode cannot save fileWhat to do if vscode cannot save fileApr 15, 2025 pm 06:03 PM

VS Code Failed to save file: Permissions issue: Ensure that the user has read and write permissions to the file/folder. Insufficient disk space: Clean up disk space to free up storage space. File occupied: Close other programs that are using files. VS Code Extension Conflict: Disable suspicious extensions and re-enable them one by one to find out the culprit. VS Code's own problem: Restart, reinstall, or check for updates to troubleshoot software.

What's going on with vscode not running pythonWhat's going on with vscode not running pythonApr 15, 2025 pm 06:00 PM

The most common "cannot run Python" problem stems from the misconfiguration of the Python interpreter path. Solutions include: confirming Python installation, configuring VS Code, and using a virtual environment. In addition, there are efficient debugging techniques and best practices such as breakpoint debugging, variable monitoring, log output, and code formatting, such as isolating dependencies using virtual environments, tracking code execution using breakpoints, and tracking variable changes in real time using monitoring expressions, etc., which can greatly improve development efficiency.

How to solve the problem of vscode cannot select python interpreterHow to solve the problem of vscode cannot select python interpreterApr 15, 2025 pm 05:57 PM

VS Code Python interpreter selection puzzle: Problem Cause: The environment configuration is confusing, which may cause the following problems: Multiple Python versions of coexistence environment variable configuration error VS Code Extension Problem Virtual Environment Problem Solving Steps: Check Python Installation Verification Environment Variable Check VS Code Python Extension Processing Virtual Environment Manually Select the Interpreter

What to do if you can't find git in vscodeWhat to do if you can't find git in vscodeApr 15, 2025 pm 05:54 PM

Troubleshooting steps: Check whether Git is installed (git --version) Install Git extensions (search "Git") Check VS Code settings ("git.path" is set correctly) Troubleshooting paths and permissions (avoid special characters, ensure read and write permissions) Clear caches and check conflicts Troubleshoot other extension conflicts

How to solve the conda environment not found in vscodeHow to solve the conda environment not found in vscodeApr 15, 2025 pm 05:51 PM

VS Code's reasons why the Conda environment cannot be found usually include inactive environments, Python extension configuration errors, Conda installation path issues, and insufficient permissions. Solutions include: 1. Activate Con2. Check Python extension configuration; 3. Verify Con2. Installation path; 4. Restart VS Code; 5. Troubleshoot permission issues.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools