Skip to content Skip to sidebar Skip to footer

Emacs And Python Environment

I have a local Python installation in //anaconda/bin/python In the command prompt $python >>import sys >>print sys.executable >>//anaconda/bin/python but, in ema

Solution 1:

You need to set the PATH environment variable that emacs uses.

Check out How do I make Emacs recognize bash environment variables for compilation?

Specifically this: https://github.com/purcell/exec-path-from-shell

On OS X, an Emacs instance started from the graphical user interface will have a different environment than a shell in a terminal window, because OS X does not run a shell during the login. Obviously this will lead to unexpected results when calling external utilities like make from Emacs.

This library works around this problem by copying important environment variables from the user's shell.

Solution 2:

As demented hedgehog wrote, you need to modify your PATH environmental variable in emacs. Specifically, add this line in your ~/.emacs or ~/.emacs.d/init.el file, depending on where your init file is.

(setenv "PATH"
    (concat"//anaconda/bin:"
     (getenv"PATH")
     )
    )

Solution 3:

Just for completeness: at Linux simply starting emacs from shell will read the current path in.

Post a Comment for "Emacs And Python Environment"