conda init不初始化新的shell [英] conda init not initialising new shell

查看:1414
本文介绍了conda init不初始化新的shell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试过多次在终端上使用命令 conda init bash初始化conda以进行外壳交互,但是它总是显示未采取任何措施。

I have tried many times to initialise conda for shell interaction using the command "conda init bash" on my terminal but it always says "No action taken."

我在做什么错?

推荐答案

问题很少,很难为您提供帮助。您应该仔细阅读并粘贴 conda init bash 输出的内容(以及您的 .bashrc .bash_profile PATH 的输出)。

With so little details in your question it's hard to help you. You should read carefully and paste what conda init bash is outputting (and your .bashrc, .bash_profile and output of PATH).

我遇到了类似的问题,发生的事情是conda初始化修改了 .bash_profile 并在末尾添加了一些代码。但是,如果在添加代码之前运行 .bashrc ,则conda在加载bashrc文件期间将无法正常运行。因此,请检查两个文件并确保它们符合您的期望(尤其是因为代码分析无法确定)。

I was in a similar issue and what happened was that the conda init modifies your .bash_profile and adds some code at the end. But if you are running your .bashrc before that code is being added then conda won't behave correctly during the loading of your bashrc file. So inspect both files and make sure they are the way you expect them (especially because code analysis is undecidable).

此外,请确保您的 PATH 环境变量看起来像您期望的那样。如果没有确定,请确保不要以意外的方式修改它,并确保conda的路径正确存在。

Also, make sure your PATH environment variable looks the way you expect. If not make sure your not modifying it in unexpected ways and that the path to conda is there correctly.

在此处查看我的答案以获取更多详细信息:为什么conda init错误地更新了我的.bash_profile?

See my answer here for more details: Why is conda init updating my .bash_profile incorrectly?

另外,如果您使用的是vscode,则可能会遇到其他问题,例如需要将 terminal.integrated.inheritEnv 设置为 false 。在此处阅读更多信息: https://code.visualstudio。 com / updates / v1_36#_launch-terminals-with-clean-environments

Additionally, if you are using vscode you might have other problems like needing to set the terminal.integrated.inheritEnv to false. Read here for more info: https://code.visualstudio.com/updates/v1_36#_launch-terminals-with-clean-environments

完全打开和关闭vscode似乎很有帮助,这样做

另一个有用的提示是在vscode的左上角显示 code 单击它然后转到首选项,然后再设置。然后,可以通过取消选择将 terminal.integrated.inheritEnv 更改为false。

Another helpful tip is to go the top left of vscode where it says code click it then go to preferences and then settings. Then you can change the terminal.integrated.inheritEnv to false by unclicking/selecting it.

这篇关于conda init不初始化新的shell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆