News from this site

 Rental advertising space, please contact the webmaster if you need cooperation


+focus
focused

classification  

no classification

tag  

no tag

date  

no datas

Anaconda下载及安装保姆级教程(详细图文)

posted on 2023-06-03 20:37     read(247)     comment(0)     like(30)     collect(4)


Prior knowledge

Anaconda refers to an open source Python distribution that 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 (about 477MB). If you only need some packages, or you need to save bandwidth or storage space, you can also use Miniconda, a smaller distribution (conda and Python only ).

Conda is an open source package and environment manager, which can be used to install different versions of software packages and their dependencies on the same machine, and can switch between different environments. Anaconda already includes Conda, and Anaconda includes Conda, Python, also includes a lot of installed toolkits, such as: numpy, pandas, etc.

Anaconda download

Download the official website: https://www.anaconda.com/products/distribution

If it is a Windows system, directly click the icon to download the latest version:
insert image description here

If not, clicking the other appropriate icon will take you to the version options for the following three operating systems:

insert image description here

Because Anaconda is cross-platform, there are Windows, macOS , and Linux versions. Here we take the Windows version as an example, and click the Windows icon (the first arrow in Figure 1).

Then downloaded is

Python 3.8 version
64-bit graphical installer (477 MB)

Of course, you can also choose the 32-Bit version according to your actual situation (most computers are 64-bit now).

Anaconda installation

Double-click the downloaded Anaconda3-2021.05 -Windows-x86_64.exe file
insert image description here

The following interface appears, click Next to proceed to the next step

insert image description here

Click I Agree (I agree)

insert image description here

Install for: Just me or All Users. If your computer has several Users, you need to consider this issue. In fact, our computer generally only has one User, and we use it alone. If your computer has multiple users, select All Users. I am here directly Just me, I am only one user, continue to click Next
insert image description here

Destination Folder means "target folder", choose where to install.

The default is to install to the C:\ProgramData\Anaconda3 folder. You can also choose Browse… to select the folder you want to install.

I don't have enough space on my C drive, so I chose to install it on my E drive.

Note: The folder must be empty, and the address in the red box does not contain Chinese, otherwise an error will be reported

Click Next

insert image description here​​​​​​​​

Let me mention here that Anaconda is very powerful and takes up a lot of space, 2.6GB, which is almost the size of a high-definition movie. However, for the sake of learning, what is this hard disk space.

Here comes Advanced Options (advanced options). Two defaults are fine. The first one is to add environment variables, which are not checked by default. The second one is to use Python 3.8 by default, which is checked by default. Click "Install" to finally start the installation.

insert image description here

The process is quite long, please be patient.

insert image description here

After a long wait, the installation is finally completed Installation Complete (installation complete), click Next>.

insert image description here

Click Next

insert image description here

Click Finish, the two √ can be canceled.
insert image description here

Anaconda configuration environment variables

If it is windows, you need to go to:
Control Panel\System and Security\System\Advanced System Settings\Environment Variables\User Variables\PATH (or directly search the advanced system settings in the search box) to add the Scripts folder of the anaconda installation directory, see personal The installation path is different and needs to be adjusted by yourself.

There are many scripts we can use:insert image description here

Enter in the search box to view advanced system settings, click to view advanced system settings.
insert image description here

Click on Environment Variables

insert image description here

Double-click the path in the user variable (the system is also OK)
insert image description here

Click New; add the Scripts folder of the anaconda installation directory, and adjust it yourself depending on the personal installation path; finally click OK.

insert image description here

Exit the environment variable, and the system property page should also be confirmed.

test configuration

Then you can open the command line (preferably opened in administrator mode)

insert image description here

enter

conda --version

If the conda version is output, it means that the environment variable is set successfully.
insert image description here

Anaconda other operations

For some subsequent uses connected with pycharm, specific principles of anaconda and other uses, see the link at the bottom of the reference [1] for details. This article only details the installation of recent versions of Ancona. In addition, use the conda command to install third-party packages and some commonly used commands. Beginners can ignore it for now, and you can read it when you use it.

Install third-party packages

enter

conda install requests

or

pip install requests

to install the requests package (or some other packages)

After the installation is complete, we enter python to enter the interpreter and import the requests package. This time it must be successful.

Uninstall third-party packages

Also take the requests package as an example, enter

conda remove requests

or

pip uninstall requests

View environment package information

To view all installed packages in the current environment you can use

conda list

insert image description here

Import and export environment

If you want to export the package information of the current environment, you can use

conda env export > environment.yaml

Store the package information in the yaml file.

When you need to recreate the same virtual environment, you can use

conda env create -f environment.yaml

other commands

Commonly used commands are listed below:

activate # 切换到base环境

activate learn # 切换到learn环境

conda create -n learn python=3 # 创建一个名为learn的环境并指定python版本为3(的最新版本)

conda env list # 列出conda管理的所有环境

conda list # 列出当前环境的所有包

conda install requests 安装requests包

conda remove requests 卸载requets包

conda remove -n learn --all # 删除learn环境及下属所有包

conda update requests 更新requests包

conda env export > environment.yaml # 导出当前环境的包信息

conda env create -f environment.yaml # 用配置文件创建新的虚拟环境


Category of website: technical article > Blog

Author:kimi

link:http://www.pythonblackhole.com/blog/article/78458/b4bbd99f3f6cc5882919/

source:python black hole net

Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.

30 0
collect article
collected

Comment content: (supports up to 255 characters)