首页 > 解决方案 > 康达激活没有效果

问题描述

尝试在我朋友的 PC 上安装 anaconda 并遇到此问题[我已修复,但找不到答案,所以我想在这里发布] PC 只是不会加载 anaconda 环境,当您键入时

>>conda activate base
>>conda info

 active environment : None

python 工作,但有这个警告

>> python
Python 3.7.3 (default, Mar 27 2019, 17:13:21) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32

Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated.  Libraries may fail to load.  To activate this environment
please see https://conda.io/activation

Type "help", "copyright", "credits" or "license" for more information.
>>>

标签: pythonwindowspowershell

解决方案


这听起来像是您自己的答案对自定义代码所做的 -将 Conda 激活代码添加到 PowerShell 的配置文件(初始化文件),$PROFILE - 已经预先打包了conda'init命令:

conda init powershell

请参阅文档或运行conda init --help

但是请注意,当以这种方式全局初始化 Conda 时,激活另一个基本环境似乎存在问题。

2019 年 3 月相关问题中的评论指出:

同时,您应该能够conda install powershell_shortcut使用不需要的替代方式conda init。它没有经过太多测试,因此欢迎并感谢您提供任何反馈。


推荐阅读