尝试在我 friend 的电脑上安装 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.
>>>
听起来像 your own answer使用自定义代码 - 将 Conda 激活代码添加到 PowerShell 的配置文件(初始化文件),$PROFILE
- 已经预装 conda
的init
命令:
conda init powershell
参见the docs或运行conda init --help
.
但是请注意,似乎有 an issue当 Conda 以这种方式全局初始化时,激活另一个基础环境。
2019 年 3 月链接问题中的评论指出:
In the meantime, you should be able to conda install powershell_shortcut
to use the alternative way that does not require conda init
. It has not seen much testing, so any feedback you have is welcome and appreciated.
我是一名优秀的程序员,十分优秀!