The latest release of Conda (4.6.1) asserts added initialization support, especially making reference to PowerShell. As can be seen in this official update release documentation
However, upon upgrade and initialization setup:
conda update conda
conda init
Producing this output:
C:\Users\User\Miniconda3\Scripts\conda.exe
C:\Users\User\Miniconda3\Scripts\conda-env.exe
C:\Users\User\Miniconda3\Scripts\conda-script.py
C:\Users\User\Miniconda3\Scripts\conda-env-script.py
C:\Users\User\Miniconda3\condabin\conda.bat
C:\Users\User\Miniconda3\Library\bin\conda.bat
C:\Users\User\Miniconda3\condabin\_conda_activate.bat
C:\Users\User\Miniconda3\condabin\conda_auto_activate.bat
C:\Users\User\Miniconda3\condabin\conda_hook.bat
C:\Users\User\Miniconda3\Scripts\activate.bat
C:\Users\User\Miniconda3\condabin\activate.bat
C:\Users\User\Miniconda3\condabin\deactivate.bat
C:\Users\User\Miniconda3\Scripts\activate
C:\Users\User\Miniconda3\Scripts\deactivate
C:\Users\User\Miniconda3\etc\profile.d\conda.sh
C:\Users\User\Miniconda3\etc\fish\conf.d\conda.fish
C:\Users\User\Miniconda3\shell\condabin\Conda.psm1
C:\Users\User\Miniconda3\shell\condabin\conda-hook.ps1
C:\Users\User\Miniconda3\Lib\site-packages\xonsh\conda.xsh
C:\Users\User\Miniconda3\etc\profile.d\conda.csh
C:\Users\User\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
(Making sure to reload a new shell session as instructed) When I attempt to initialize in PowerShell, I get this error message upon immediately loading PowerShell (prior to attempting conda activate myenv):
. : File C:\Users\User\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 cannot be loaded because running
scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:3
+ . 'C:\Users\User\Documents\WindowsPowerShell\Microsoft.PowerShell_p ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Based on This link to the Microsoft Execution Policies it appears to be a security issue. I'm assuming Conda has submitted the proper publishing certifications, however despite the above conda init output showing amendment to the PowerShell_profile.ps1 file (second last line in the above 'conda init' output), I cannot get conda to initialize in PowerShell.
This link instructs on how to manually set the Execution Policy for RemoteSigned
Instructing:
Run shell as Administrator.
> Get-ExecutionPolicy
> Set-ExecutionPolicy remoteSigned
Done.
To Undo
> Set-ExecutionPolicy restricted
And provides a link to the official Microsoft.PowerShell.Security Documentation
And as I already documented here
However, I'm hesitant to make the manual adjustments as I have run into issues with setting the policy in the past, and am concerned that it will make more of a mess of things than clean up the PowerShell integration issues, particularly considering the latest conda release was intended to do this structurally/natively.
Is it possible that I simply need to update my PowerShell? I have Windows 10 and am running PowerShell version 5.1.
Any help would be very much appreciated as I am dying to have conda integrated in Visual Studio Code terminal.