windows10下激活conda环境报错CommandNotFoundError: Your shell has not been properly configured to use conda

因为安装Anaconda是比较久以前的事情,安装了之后又没有用过,最近想用来机器学习,安装pytorch啥的,于是捡了回来。
首先查看了我电脑上的conda环境以及版本

conda info --env

windows10下激活conda环境报错CommandNotFoundError: Your shell has not been properly configured to use conda_第1张图片
然后查看了一下版本,创建了一个自己的conda环境(-n就是-name的意思,指定名字,后面就是自定义的名字),我没有指定python版本估计就是最新的吧,创建完毕之后,可以看到有提示信息提示你激活

conda -V
conda create -n myPytorch

windows10下激活conda环境报错CommandNotFoundError: Your shell has not been properly configured to use conda_第2张图片
但是当我按照它的命令激活的时候,提示CommandNotFoundError

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If your shell is Bash or a Bourne variant, enable conda for the current user with

    $ echo ". E:\Anaconda3/etc/profile.d/conda.sh" >> ~/.bashrc

or, for all users, enable conda with

    $ sudo ln -s E:\Anaconda3/etc/profile.d/conda.sh /etc/profile.d/conda.sh

The options above will permanently enable the 'conda' command, but they do NOT
put conda's base (root) environment on PATH.  To do so, run

    $ conda activate

in your terminal, or to put the base environment on PATH permanently, run

    $ echo "conda activate" >> ~/.bashrc

Previous to conda 4.4, the recommended way to activate conda was to modify PATH in
your ~/.bashrc file.  You should manually remove the line that looks like

    export PATH="E:\Anaconda3/bin:$PATH"

^^^ The above line should NO LONGER be in your ~/.bashrc file! ^^^

但是此时看了一下conda的环境中已经创建好了
windows10下激活conda环境报错CommandNotFoundError: Your shell has not been properly configured to use conda_第3张图片
搜索了一下,说是可能电脑上的conda的初始的base环境就没有激活,所以先输入activate激活并进入到base环境,在此环境下再去激活新创建的环境即可
windows10下激活conda环境报错CommandNotFoundError: Your shell has not been properly configured to use conda_第4张图片
发现前面有小括号代表了是什么样的环境
所以就可以开始后面的激活对应的pytorch环境啦

你可能感兴趣的:(机器学习-win,conda,python,windows,机器学习,pytorch)