search
HomeDevelopment ToolsVSCodeA brief analysis of how to use anaconda to import python library in vscode

How to import python library in vscode? The following article will show you how to use anaconda to import the python library in vscode. I hope it will be helpful to you!

A brief analysis of how to use anaconda to import python library in vscode

#When I first started learning to write python using vscode, I encountered many problems.

This time the code needs to import numpy, pandas and other libraries. After browsing many methods on the Internet, I found what I thought was the easiest method: Use anaconda to import the library.
It also facilitates the import of other libraries in the future. [Recommended learning: vscode tutorial, Programming teaching]

Existing environment: vs code has been installed and the plug-in used to run python

Install anaconda


##Introduction to Anacond

Anaconda refers to an open source Python distribution, which includes more than 180 scientific packages such as conda and Python and their Dependencies. Because it contains a large number of scientific packages, the download file of Anaconda is relatively large (400 MB). If you only need certain packages, or need to save bandwidth or storage space, you can also use Miniconda, a smaller distribution (containing only conda and Python ).

Conda is an open source package and environment manager that can be used to install different versions of software packages and their dependencies on the same machine, and can switch between different environments

Anaconda includes Conda, Python and a lot of installed tool packages, such as: numpy, pandas, etc.

Miniconda includes Conda, Python

Anacond download and installation

Official website download address:

link

You can refer to this article to download and install. There are several points to note:

link

Test


Reference article:

link 1. Open cmd [WIN R /cmd]
Enter -conda list.
As shown in the figure below, Anaconda is installed successfully.

A brief analysis of how to use anaconda to import python library in vscode 2. Create an environment

Enter -conda create -n test python=3.8.3 pip

#Modify the Python version according to the version number, such as your python If the version is 3.7, change it to -conda create -n test python=3.7 pip

A brief analysis of how to use anaconda to import python library in vscode #You can see the Python version in the lower left corner of the vs code page

A brief analysis of how to use anaconda to import python library in vscode Proceed (y/[n])? will appear, enter y
The rest of the steps are explained clearly in the article linked above

vscode configuration environment


Problems encountered: The current code needs to import the numpy library


Solution:

1. Still click on the version number in the lower left corner of vs code , the options in the figure below will appear, select the interpreter as test: conda version

A brief analysis of how to use anaconda to import python library in vscode 2. At this time, the error is still reported when running, saying that there is no numpy library, we need to install this library
3. Open cmd, enter -conda install numpy, run it again after successfully installing the numpy library, and solve the problem
Reference article for the process of installing the library:
link

Conclusion


#1. You can use the above method to install various libraries, which is simple and convenient.

2. By learning other people’s methods and then summarizing records, I hope to be able to help others

For more relevant knowledge about VSCode, please visit:

vscode Basic Tutorial!

The above is the detailed content of A brief analysis of how to use anaconda to import python library in vscode. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:csdn. If there is any infringement, please contact admin@php.cn delete
手把手带你会习VSCode debug,不信你还不会!手把手带你会习VSCode debug,不信你还不会!Mar 31, 2022 pm 08:45 PM

2022年了,该学会用VSCode debug了!下面本篇文章手把手带大家会习VSCode debug,希望对大家有所帮助!

浅析VSCode怎么关闭自动更新浅析VSCode怎么关闭自动更新Jun 02, 2022 pm 12:56 PM

VSCode怎么关闭自动更新?下面本篇文章给大家介绍一下VSCode关闭自动更新的方法,希望对大家有所帮助!

手把手带你在VSCode中配置 Geant4 和 Root手把手带你在VSCode中配置 Geant4 和 RootApr 25, 2022 pm 08:57 PM

本篇是VSCode配置文章,手把手教大家怎么在VSCode​中配置使用 Geant4 和 Root,希望对大家有所帮助!

扒一扒vscode Prettier选项中的16个实用属性,让代码变美!扒一扒vscode Prettier选项中的16个实用属性,让代码变美!May 03, 2022 am 10:00 AM

本篇文章扒拉一下vscode Prettier的选项,总结分享16个让你的代码变漂亮的属性,希望对大家有所帮助!

23个提高开发效率的前端VSCode插件(快来收藏)23个提高开发效率的前端VSCode插件(快来收藏)Jul 25, 2022 pm 08:06 PM

本篇文章给大家分享23个前端VSCode插件,助你提高开发效率,让你事半功倍,快来收藏吧!

总结分享12个好玩有趣的 VSCODE 插件总结分享12个好玩有趣的 VSCODE 插件May 27, 2022 am 11:06 AM

“工欲善其事,必先利其器!”,vscode作为前端开发的重要工具,其插件能大幅提升战斗力,精心收集12个插件,总有几款你还未曾拥有。

VSCode中如何开发uni-app?(教程分享)VSCode中如何开发uni-app?(教程分享)May 13, 2022 pm 08:11 PM

VSCode中如何开发uni-app?下面本篇文章给大家分享一下VSCode中开发uni-app的教程,这可能是最好、最详细的教程了。快来看看!

手把手教你在VScode中配置C/C++环境(Win下)手把手教你在VScode中配置C/C++环境(Win下)Oct 10, 2022 pm 06:52 PM

VScode中怎么开发置C/C++?怎么配置C/C++环境?下面本篇文章给大家分享一下Windows系统下VScode配置C/C++环境图文教程,希望对大家有所帮助!

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)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version