3

I want to use python in spacemacs on window OS, and need to tell it where to find python shell. So I added one line of

(setq-default python-shell-interpreter "C:\Anaconda\Scripts\ipython.exe")

to the .spacemacs

But when restart the spacemacs, it won't start up as spacemacs, instead it's like normal emacs without spacemacs installed. But if I remove that line, I could get the spacemacs screen, so how should I set the variable in spacemacs init file?

(defun dotspacemacs/init ()
  "Initialization function.
This function is called at the very startup of Spacemacs initialization
before layers configuration."   
  ;; This setq-default sexp is an exhaustive list of all the supported  
  ;; spacemacs settings.   
  dotspacemacs-default-package-repository nil)  
 ;; User initialization goes here   
(setq-default python-shell-interpreter "C:\Anaconda\Scripts\ipython.exe")
)
  • Please use the code formatting tool ({} button or C-k key combination) to format code, not the quote tool which messes up line breaks and interprets special characters. – Gilles 'SO- stop being evil' Jun 3 '15 at 19:32
7

In Emacs Lisp, backslashes inside strings start escape sequences. For example, \n means a newline, and \a means a bell character.

If a string contains an unknown escape sequence, an error is signalled. \A is an unknown escape sequence, and it seems like this leads to the rest of the init file not being loaded.

You can either specify the path with forward slashes:

(setq-default python-shell-interpreter "C:/Anaconda/Scripts/ipython.exe")

or escape the backslashes with another backslash:

(setq-default python-shell-interpreter "C:\\Anaconda\\Scripts\\ipython.exe")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.