shadfien / python_opencv

opencv问题
0 stars 0 forks source link

终端使用conda激活环境时报错解决方法Your shell has not been properly configured to use 'conda activate'. #14

Open shadfien opened 2 years ago

shadfien commented 2 years ago

每次打开终端就会自动弹出下边的内容,试了一顿方法最终也没搞明白怎么成功的。 按照说明,在~/.bashrc里添加 /home/laoer/anaconda3/etc/profile.d/conda.sh 然后添加conda activate

结果每次打开终端都是在base状态,然后把conda activate 删除就行了。。。没搞明白。。。 还有说什么.zshrc的,反正试了一通应该是跟我没关系的。

`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 ". /home/laoer/anaconda3/etc/profile.d/conda.sh" >> ~/.bashrc

or, for all users, enable conda with

$ sudo ln -s /home/laoer/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="/home/laoer/anaconda3/bin:$PATH"

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

`