本文介绍了conda命令将提示错误:“错误的解释器:没有这样的文件或目录";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

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

I'm using arch linux and I've installed Anaconda as per the instruction on the Anaconda site. When I'm attempting to run conda info --envs I get the following error:

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

I've tryed looking for the directory /opt/anaconda1anaconda2anaconda3/bin/python: but it simply doesn't exist.

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

Furthermore, when I run python from the terminal it runs as normal with the following displayed at the top

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文件类似于:

for completeness my .bashrc file resembles:

#
# ~/.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

我尝试按照​​未找到Conda命令进行相应的更改,但是没什么,我也尝试 Conda命令未找到,路径在.bashrc ,但实际上并没有发布解决方案.

I've tried following the Conda command not found and making the the appropriate changes but nothing, I've also attempted to Conda command not found, path is in .bashrc but there really isn't a solution posted.

我想尝试解决此问题,而不必删除Anaconda并重新安装.

I would like to try to fix this without having to remove Anaconda and reinstalling it.

推荐答案

在安装过程中某些地方肯定出了问题.如您正确指出的那样,不良的解释器意味着脚本正在寻找不存在的解释器.

Something must have gone wrong during the installation, I suppose.The bad interpreter means that a script is looking for an interpreter that doesn't exist - as you rightfully pointed out.

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

The problem is likely to be in the shebang #! statement of your conda script.

如果您运行

cat ~/anaconda3/bin/conda

您可能会得到以下信息:

You will probably get the following:

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

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

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

Changing the first line to point a correct interpreter, i.e., changing it to:

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

应该使conda命令起作用.

如果您确定一切安装正确,那么我建议您可以从anaconda社区寻求支持

If you are sure that you installed everything properly, then I'd suggest maybe reaching out for support from the anaconda community.

这篇关于conda命令将提示错误:“错误的解释器:没有这样的文件或目录";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 23:07