Skip to content

Anaconda won't start in my Mac terminal(ZSH) #1831

Closed
@liqimore

Description

@liqimore

while i click on open terminal in Anaconda Navigator,i got this error:

Last login: Thu Jun  1 16:31:16 on ttys001
/Users/Qi/.anaconda/navigator/a.tool ; exit;

# Qi @ 😃  in ~ [16:32:37] 
$ /Users/xxx/.anaconda/navigator/a.tool ; exit;
/Users/xxx/.anaconda/navigator/a.tool: line 1: syntax error near unexpected token `('
/Users/xxx/.anaconda/navigator/a.tool: line 1: `bash --init-file <(echo "source activate /Users/xxx/anaconda/anaconda;")'

[Process completed]


system info:

$ conda info
Current conda install:

               platform : osx-64
          conda version : 4.3.21
       conda is private : False
      conda-env version : 4.3.21
    conda-build version : not installed
         python version : 3.6.1.final.0
       requests version : 2.14.2
       root environment : /Users/xxx/anaconda/anaconda  (writable)
    default environment : /Users/xxx/anaconda/anaconda
       envs directories : /Users/xxxx/anaconda/anaconda/envs
                          /Users/xxx/.conda/envs
          package cache : /Users/Qi/anaconda/anaconda/pkgs
                          /Users/xxx/.conda/pkgs
           channel URLs : https://repo.continuum.io/pkgs/free/osx-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/osx-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/osx-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : /Users/xxx/.condarc
             netrc file : None
           offline mode : False
             user-agent : conda/4.3.21 requests/2.14.2 CPython/3.6.1 Darwin/15.6.0 OSX/10.11.6
                UID:GID : 501:20

MacOS is currently at version 10.11.6 (15G1217)
I reinstalled serval times, but keep getting this error.don't what's wrong with it
i found this and tried, but not working
https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/GsXlOi48d7Y

Activity

goanpeca

goanpeca commented on Jun 1, 2017

@goanpeca

@martindurant do you have idea of what is going on?

goanpeca

goanpeca commented on Jun 1, 2017

@goanpeca

If you open ipython you see the same problem?

self-assigned this
on Jun 1, 2017
martindurant

martindurant commented on Jun 1, 2017

@martindurant

The message suggests that the bash syntax in the temporary script is not valid in zsh. I've never used zsh... What surprises me, is that the same file apparently calls a different shell interpreter depending on your setup. Is there a way in darwin to be specific?
(for the record, osx provided by far the most problems in this regard)

goanpeca

goanpeca commented on Jun 1, 2017

@goanpeca

Ohh, @liqimore ok we only support bash (on OSX)!

liqimore

liqimore commented on Jun 3, 2017

@liqimore
Author

Thanks guys! I'v figured it out and yes, It only support bash on OSX.I tried oh-my-zsh(fish) and something else, None of these works.Bash is the only one that works on my machine.It might because the syntax difference between bash and other shells.
And way, Thanks!

goanpeca

goanpeca commented on Jun 3, 2017

@goanpeca

@liqimore we will introduce a more general syntax for version 1.6.3 so that it should work on most other terminals :-)

goanpeca

goanpeca commented on Jun 6, 2017

@goanpeca
Evanqiao

Evanqiao commented on Jul 8, 2017

@Evanqiao

@liqimore I have the problem too. I find that using "chsh -s /bin/bash" switch sh to bash can makeAnaconda Navigator work. Then I can also use "chsh -s /bin/zsh" to switch sh to zsh.

daehyunpy

daehyunpy commented on Apr 8, 2018

@daehyunpy

a.tool file seems like generated every time before it called; and the contents is just a line bash --init-file <(echo "source activate PATH_TO_ANACONDA;"). Why don't we just add #!/bin/bash before the line when the file will be generated. Then it should work on any shells.

martindurant

martindurant commented on Apr 8, 2018

@martindurant
af001

af001 commented on Apr 21, 2018

@af001

Quick fix is to change shells before opening the terminal for your environment:

chsh -s /bin/bash

+1 to @Evanqiao solution

heitaoq66

heitaoq66 commented on Sep 30, 2018

@heitaoq66

This problem is a problem with the zsh environment variable, the solution
echo 'source ~/.bash_profile' >> ~/.zshrc
Append the bash environment variable to zsh

frank890417

frank890417 commented on Oct 23, 2018

@frank890417

@heitaoq66 Solved like a charm when using ZSH!

ck244

ck244 commented on Jan 6, 2019

@ck244

I found that sourcing .bash_profile was preventing me from running zsh at all, so I just appended export PATH="/Users/(username)/anaconda/bin:$PATH" to my .zshrc file and that worked.

lporras

lporras commented on Jun 5, 2019

@lporras
stings8

stings8 commented on Oct 10, 2019

@stings8

the @ck244 solution worked for me

DrMcQ

DrMcQ commented on Oct 22, 2019

@DrMcQ

I have the same issue and I couldn't figure it out. I couldn't update anything in Anaconda. When I opened the terminal, it asked me to change the shell to ZSH. I did so. Then, the following issue happened. I have tried to change the shell to BASH, yet still doesn't work.

Last login: Tue Oct 22 16:11:48 on ttys000
/Users/yulin/.anaconda/navigator/a.tool ; exit;
lin@Dr ~ % /Users/lin/.anaconda/navigator/a.tool ; exit;
/Users/lin/.anaconda/navigator/a.tool: line 1: syntax error near unexpected token (' /Users/lin/.anaconda/navigator/a.tool: line 1: bash --init-file <(echo "source activate /opt/anaconda3;")'

[Process completed]

vin-ni

vin-ni commented on Dec 26, 2019

@vin-ni

I hat to conda init zsh to get conda to work with the shell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lporras@goanpeca@frank890417@daehyunpy@martindurant

        Issue actions

          Anaconda won't start in my Mac terminal(ZSH) · Issue #1831 · ContinuumIO/anaconda-issues