Import conda error traceback upon opening terminal

前端 未结 4 930

The below lines of code show up every time I open my terminal.

Traceback (most recent call last):
  File \"\", line 3, in 
ImportE         


        
相关标签:
4条回答
  • 2021-01-13 22:37

    Having the same issue. For me a temporary fix was commenting out the eval and its else if loop in bashrc.

    There is a thread on this issue on the github of conda: https://github.com/conda/conda/issues/9505

    edit: It was an error in 4.8.0 anaconda. In <conda_install>/etc/bash_completion.d/conda python was called without adding the path towards the anaconda python, with as a result that it opened python 2.7 and then tried to import conda. It has been fixed by the most recent update, so running conda update conda should fix the issue!

    0 讨论(0)
  • 2021-01-13 22:38

    I think this is related to an upstream issue since I am facing the same problem since this morning on two different machines. So I would suggest to not modify your RC files.

    0 讨论(0)
  • 2021-01-13 22:41

    The error has been fixed, you need to do a conda update conda in your terminal and it will work like a charm.

    0 讨论(0)
  • 2021-01-13 23:00

    I had the same problem The reason is in .bashrc:

    # >>> conda initialize >>>
    # !! Contents within this block are managed by 'conda init' !!
    __conda_setup="$('/home/myname/app/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
    if [ $? -eq 0 ]; then
        eval "$__conda_setup"
    else
        if [ -f "/home/myname/app/miniconda3/etc/profile.d/conda.sh" ]; then
            . "/home/myname/app/miniconda3/etc/profile.d/conda.sh"
        else
            export PATH="/home/myname/app/miniconda3/bin:$PATH"
        fi
    fi
    unset __conda_setup
    
    

    Problematic line:

    eval "$__conda_setup"
    

    Solved by replacing the whole block with:

    export PATH="/home/myname/app/miniconda3/bin:$PATH"
    
    0 讨论(0)
提交回复
热议问题