0

I installed anaconda in my Mac. It works correct, and in the "Base" env, I setup python3. But in the zsh of emacs(M-x term ret, /bin/zsh ret), in the "Base" env, the python version is python2.7.

I've tried M-x shell, it didn't work either.

In system zsh, after "which python" command: /Users/username/anaconda3/bin/python

In emacs zsh, after "which python" command: /usr/bin/python

In system zsh, after "python --version" command: Python 3.7.3

In emacs zsh, after "python --version" command: Python 2.7.10

In both zsh, there is "(Base)" at the beginning of the line

Felix
  • 21
  • 2
  • are your paths the same in both shells, eg. `echo $PATH` (probably not). For mac users, I think people use [exec-path-from-shell](https://github.com/purcell/exec-path-from-shell) – Rorschach Sep 05 '19 at 04:31
  • You apparently have to make your Emacs zsh read the startup file which enables Anaconda for you in the regular shell. I don't know enough about zsh to direct you but it sounds like there's an easy duplicate somewhere here on Stack Overflow. – tripleee Sep 05 '19 at 04:49
  • Possible duplicate of https://stackoverflow.com/questions/40370467/anaconda-not-found-in-zsh – tripleee Sep 05 '19 at 04:49
  • @jenesaisquoi You are right, I tried exec-path-from-shell, and it works. Thanks! – Felix Sep 05 '19 at 05:51
  • @tripleee It is because environment variables inside Emacs are different with system shell(.zshrc) – Felix Sep 05 '19 at 06:07
  • Well yes, I think we can all see that. Perhaps there would be a way to start Zsh inside Emacs which would use the same settings as outside, but again, I'm not familiar enough with Zsh to tell you where to look, and you are not revealing how exactly you are running Zsh inside Emacs anyway. – tripleee Sep 05 '19 at 06:18
  • As you are running zsh in both settings you should check which file they are reading - emacs under macOS won't be reading .zlogin or .zprofile as it is not via a login shell. Terminal will bey default have used these. – mmmmmm Sep 05 '19 at 08:23

0 Answers0