[PYTHON] How to eliminate the conda activate error without annoying execution policy changes

Difference from other articles

It takes some time to use ```Anacondaand Minicondain the PowerShellenvironment. [This article](https://qiita.com/8128/items/877caf785b20758ba7e0), [This article](https://qiita.com/yniji/items/668f805a72a6ced6a2bd) and [This article](https://www) Like .gesource.jp/weblog/?p=8254), every time you want to "develop", you need to change the execution policy. Alternatively, you can save yourself the trouble of entering commands every time, knowing the security risks. Alternatively, you can give up PowerShelland set cmd`` as the default terminal.

In this article ・ ** Without typing troublesome commands every time **, ・ ** Security can be guaranteed **, ・ It can be realized with ** PowerShell ** I will show you how.

  1. Start VS Code.
  2. Type conda init powershell in the terminal and execute.
  3. Click `ʻExtension`` (block-like icon) on the left side.
  4. Type PowerShell and Install the one that appears at the top.
  5. Restart VSCode just in case.
  6. PowerShell Command Explorer ( PowerShell icon) should be added on the left side, so click it.
  7. If the terminal starts up and the following display appears, it is successful.

                  =====> PowerShell Integrated Console <=====


(base) PS C:\Users\Honyara\Documents\Hogehoge\src> 

Check execution policy

$ Get-ExecutionPolicy -List

        Scope ExecutionPolicy
        ----- ---------------
MachinePolicy       Undefined
   UserPolicy       Undefined
      Process          Bypass
  CurrentUser       Undefined
 LocalMachine       Undefined

Since it is a Process unit, there is no problem in terms of security.

For those who are even more greedy

In the current state, when you want to use PowerShell normally, it should be annoying to be told that profile.ps1 cannot be loaded. Eliminate it.

  1. Move to $ env: USERPROFILE \ Documents \ WindowsPowerShell.
  2. Since profile.ps1 should have been created in the previous step, rename it to Microsoft.VSCode_profile.ps1.

Supplementary information

The author's OS is Windows 10 64bit

Recommended Posts

How to eliminate the conda activate error without annoying execution policy changes
How to use the generator
How to use the decorator
How to increase the axis
How to keep conda off
How to start the program
How to intentionally issue an error in the shell During testing
[sh] How to store the command execution result in a variable
How to monitor the execution status of sqlldr with the pv command
How to resolve the error from toimage (from PIL.Image import fromarray as toimage)
How to reflect validation error and input contents on the previous page without using render in the action