Use Anaconda to complete the installation and configuration of the Python environment

1 Anaconda

1.1 Configuration process

Anaconda is an open source Python and R programming language package manager and environment manager for data science and machine learning development.

  1. Enter the official website https://www.anaconda.com/ to download the installation package
  2. next->argee to enter the following interface, select Just Me
    insert image description here
  3. Select the installation path and click Next
    insert image description here
  4. The next screen has two options. The first one is to add environment variables, do not check here, and configure manually later. The second is to set the default environment, check it.
    insert image description here
  5. Environment configuration, four items need to be configured (here D:\anaconda3 is my installation path, replace it as needed).
    insert image description here
  6. Enter conda in Power Shell to verify, and the result similar to the following appears successfully
    insert image description here

1.2 Question 1

When using Power Shell, there may be problems with the environment that cannot be activated using conda activate:

PS C:\Windows\system32> Set-ExecutionPolicy RemoteSigned
 
执行策略更改
执行策略可帮助你防止执行不信任的脚本。更改执行策略可能会产生安全风险,如 https:/go.microsoft.com/fwlink/?LinkID=135170
中的 about_Execution_Policies 帮助主题所述。是否要更改执行策略?
[Y] 是(Y)  [A] 全是(A)  [N] 否(N)  [L] 全否(L)  [S] 暂停(S)  [?] 帮助 (默认值为“N”): Y
PS C:\Windows\system32>

It can be solved by typing in power shell conda init powershell. However, the following problem 2 may appear, and I will also make an introduction

1.3 Question 2

Solve the problem that the power shell cannot be activated using conda activate through the above, and there may be a problem that the file cannot be loaded, and the error is reported as:

. : 无法加载文件 C:\Users\Administrator\Documents\WindowsPowerShell\profile.ps1。未对文件 C:\Users\Administrator\Docume
nts\WindowsPowerShell\profile.ps1 进行数字签名。无法在当前系统上运行该脚本。有关运行脚本和设置执行策略的详细信息,请参
阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 3
+ . 'C:\Users\Administrator\Documents\WindowsPowerShell\profile.ps1'
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Can be resolved by executing in admin stateset-executionpolicy remotesigned

2 Pycharm

2.1 Installation

Download it on the official website https://www.jetbrains.com/pycharm/ , select the community version here
insert image description here
insert image description here
and follow the same next to complete the installation.

2.2 Configuration

  1. After opening a folder or creating a project, select File, then click Setting
    insert image description here
  2. Then click Project = "Python Interpreter
    insert image description here
  3. Click Add Interpreter, the Add Python Interpreter interface appears
    insert image description here
  4. Select Existing, browse to find your own environment address, and select okinsert image description here

Guess you like

Origin blog.csdn.net/weixin_51691064/article/details/131625591