【问题标题】:anaconda not recognised after updating environment variable linux更新环境变量linux后无法识别anaconda
【发布时间】:2018-05-25 10:34:26
【问题描述】:

我通过运行以下命令在 linux red hat 系统上安装了 anaconda(在我没有 sudo 权限或互联网访问权限的 airgapped 远程系统上)。

$bash Anaconda3-5.1.0.Linux-x86_64.sh

这已经在/home/myuser/anaconda3/目录下安装了anaconda

.bashrc 文件内容为:

#added by Anaconda3 installer
. /opt/projectname/bin/setenv.sh
export PATH="/home/myuser/anaconda3/bin:$PATH"

当我跑步时 $conda$jupyter notebook,我得到 command not found

$python 启动未链接到 anaconda 的旧版 python。

如果我跑:

$bash jupyter notebook 

来自 /home/myuser/anaconda3/bin/

我明白了:

jupyter: line 4: import: command not found
jupyter: line 5: import: command not found
etc...

如何让系统运行正确版本的 python 并成功启动 jupyter notebook?

编辑:这里的问题是 anaconda 安装在 /home/myuser 而不是 /usr/x/opt/x

【问题讨论】:

  • "气隙遥控器" - 选择一个。
  • 哈哈,好点子。抱歉,我的意思是,可以远程访问,但无法访问 Internet(系统管理员为我下载了安装程序文件)
  • 修改.bashrc后是否注销并重新登录?
  • 尝试. .bashrc手动加载.bashrc。这会更新你的 PATH 吗?
  • . 来源它,所以再次尝试回显。

标签: linux anaconda jupyter-notebook redhat


【解决方案1】:

在终端上试试这个

source /home/myuser/anaconda3/bin/activate

这将激活您的 anaconda python 安装。 (base) 应该出现在您的终端中。

现在 jupyter notebook 应该可以工作了。

注意:我没有将 anaconda3/bin 附加到 PATH 变量中,因为我想将我的原始 python 安装保留为默认值。每次需要时,我都会使用上述命令激活 anaconda3。

【讨论】:

    猜你喜欢
    • 2016-02-04
    • 1970-01-01
    • 1970-01-01
    • 2016-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-03
    相关资源
    最近更新 更多