anaconda powershell prompt如何激活环境
时间: 2023-10-18 17:55:06 浏览: 186
要激活Anaconda PowerShell Prompt中的环境,你可以按照以下步骤进行操作。首先,找到Anaconda PowerShell Prompt的属性。然后,将属性的目标值修改为以下命令:
%windir%\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy ByPass -NoExit -Command "& 'C:\ProgramData\Anaconda3\shell\condabin\conda-hook.ps1' ; conda activate foo"
其中,'foo'是你想要激活的虚拟环境的名称。这样,当你打开Anaconda PowerShell Prompt时,它会自动激活指定的虚拟环境。\[1\]
另外,如果你想了解Anaconda PowerShell Prompt的原理,它与Anaconda Prompt的原理类似。它们都是通过运行PowerShell程序来实现的。具体来说,Anaconda PowerShell Prompt的路径是%windir%\System32\WindowsPowerShell\v1.0\powershell.exe。然后,通过使用相关参数(-ExecutionPolicy ByPass -NoExit -Command)来执行Anaconda的powershell脚本('C:\ProgramData\Anaconda3\shell\condabin\conda-hook.ps1'),最后使用conda activate命令来激活指定的虚拟环境('C:\ProgramData\Anaconda3')。\[2\]\[3\]
#### 引用[.reference_title]
- *1* *3* [Anaconda Prompt和Anaconda PowerShell Prompt工作原理](https://blog.csdn.net/mighty13/article/details/119881204)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [anaconda prompt和cmd和powershell和anaconda powershell prompt和git bash有什么区别](https://blog.csdn.net/Hodors/article/details/127218259)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文