当前位置:   article > 正文

ubuntu的anaconda无法激活环境Your shell has not been properly configured to use ‘conda activate‘._ubuntu commandnotfounderror: your shell has not be

ubuntu commandnotfounderror: your shell has not been properly configured to

ubuntu22.04安装好anaconda

conda create -n pytorch python=3.9
  • 1

想激活

conda activate pytorch
  • 1

但是遇到如下报错

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.                                                                      
To initialize your shell, run                                                   
                                                                                
    $ conda init <SHELL_NAME>
  • 1
  • 2
  • 3
  • 4

解决办法:

conda init bash
  • 1

然后先是

source activate
  • 1

接着才是

conda activate pytorch
  • 1

验证以下:

python
  • 1
import torch
  • 1
print(torch.cuda.is_available())
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Guff_9hys/article/detail/924572
推荐阅读
相关标签
  

闽ICP备14008679号