【问题标题】:export PATH="/home/user/miniconda3/bin:$PATH" after every start每次启动后 export PATH="/home/user/miniconda3/bin:$PATH"
【发布时间】:2021-07-14 09:42:40
【问题描述】:

我已经为 Linux 的 Windows 子系统安装了 Miniconda。每次启动 VScode 终端时,我都会收到消息:conda command not found。只有当我输入命令时,我才能使用conda:

  1. source ~/.bashrc
  2. export PATH="/home/user/miniconda3/bin:$PATH"

有办法解决吗?

我也将export PATH="/home/user/miniconda3/bin:$PATH" 也放在了ubuntu 终端上,但它并没有改变任何东西。

【问题讨论】:

  • 你在哪里输入这些命令?在 shell 中,将配置添加到 shell 的启动文件中(.bash_profile,如果你的 shell 是 Bash),或者在 VSCode 配置中的某处(可能也是常见问题解答),如果这不起作用。
  • 在 Ubuntu shell 和 VSCode 终端中。主目录实际上包含 .bash_profile。

标签: python windows-subsystem-for-linux


【解决方案1】:

确保您的主目录中有一个名为 .bash_profile 的文件。该文件将调用您的 .bashrc 文件。它应该是在您设置操作系统或创建 .bashrc 文件时自动生成的,但您也可以手动创建它:

.bash_profile:

test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc

.bashrc:

export PATH="/home/user/miniconda3/bin:$PATH"

如果问题只出现在 VSCode 中,这个帖子也可能有帮助:VSCode Integrated Terminal Doesn't Load .bashrc or .bash_profile

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-28
    • 1970-01-01
    • 2020-02-24
    • 2017-11-26
    • 1970-01-01
    • 2016-05-23
    • 1970-01-01
    • 2021-03-07
    相关资源
    最近更新 更多