我使用的是arch linux,我已经按照Anaconda网站上的说明安装了Anaconda.当我try 运行conda info --envs 时,会出现以下错误:

bash:/home/lukasz/anaconda3/bin/conda:

我试着寻找目录/opt/anaconda1anaconda2anaconda3/bin/python:,但它根本不存在.

此外,当我从终端运行python时,它正常运行,顶部显示以下内容

Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.

为了完整起见,我的.bashrc文件类似于:

#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '

# added by Anaconda3 4.0.0 installer
export PATH="/home/lukasz/anaconda3/bin:$PATH"

# python startup for up keys
export PYTHONSTARTUP=$HOME/.pythonstartup

我试着按照this条进行适当的修改,但什么都没有,我也试着按照this条进行修改,但确实没有发布解决方案.

我想try 修复这个问题,而不必移除Anaconda并重新安装它.

推荐答案

我想安装过程中一定出了什么问题.

问题很可能出在你的conda 脚本的shebang #!语句中.

100: Under Unix-like operating systems, when a script with a shebang is run as a program, the program loader parses the rest of the script's initial line as an interpreter directive; the specified interpreter program is run instead, passing to it as an argument the path that was initially used when attempting to run the script.

如果你跑

cat ~/anaconda3/bin/conda

您可能会得到以下结果:

#!/opt/anaconda1anaconda2anaconda3/bin/python
if __name__ == '__main__':
    import sys
    import conda.cli

    sys.exit(conda.cli.main())

将第一行更改为指向正确的解释器,即将其更改为:

#!/home/lukasz/anaconda3/bin/python

应该能让conda指令生效.

如果你确定所有的东西都安装好了,那么我建议你向support from the anaconda community.个用户咨询

Linux相关问答推荐

Arch_prctl的用例是什么

为什么 `std::this_thread::yield()` 比 `std::this_thread::sleep_for(0s)` 慢 10 倍?

从 curl 命令输出中获取值

如何拆分多个分隔符但将它们保留在方括号之间?

为什么我的 Docker 进程不断在我的 Raspberry Pi 上重新启动?

如何使用 shell 脚本将文本文件转换为 JSON 文件

给定两个目录树如何找到相同的文件?

如何在 Ubuntu 12.04 中更改 Jenkins 安装的端口号

仅在不存在时添加换行符

在亚马逊 ec2 linux 微型实例上的 virtualenv 中安装 scipy 时遇到问题

使用inotify的正确方法是什么?

docker images显示图像,docker rmi表示没有这样的图像或参考不存在

如果关键字触发然后执行命令,Shell 脚本来监视日志(log)文件?

从命令行导入 PostgreSQL CSV

如何找到只对所有者具有特定权限的文件?

限制程序在 Linux 中运行的时间

是否有git sed或类似功能?

初学者如何在 Linux 中开始使用 Mono?

在 Linux 中,名称与正则表达式匹配的文件的磁盘使用情况?

linux perf:如何解释和查找热点