3

I've had my emacs (v. 25.1.1) working with elpy (1.13) under Python 2.7 for a while. I decided to switch to Python 3 recently, and cannot get it to interact with emacs properly. Normally, when I want to run a script in emacs I C-c C-c, which opens an ipython interpreter. Since switching to Python3, the ipython interpreter still opens, but with problems.

  1. I get the following backtrace error:

.

Debugger entered--Lisp error: (args-out-of-range "Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) 
Type \"copyright\", \"credits\" or \"license\" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

[6n[0m
[0m[J
" 427)
  string-match("" "Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) \nType \"copyright\", \"credits\" or \"license\" for more information.\n\nIPython 5.1.0 -- An enhanced Interactive Python.\n?         -> Introduction and overview of IPython's features.\n%quickref -> Quick reference.\nhelp      -> Python's own help system.\nobject?   -> Details about 'object', use 'object??' for extra details.\n\n[6n[0m
[0m[J
" 427)
  ansi-color-filter-apply("Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) \nType \"copyright\", \"credits\" or \"license\" for more information.\n\nIPython 5.1.0 -- An enhanced Interactive Python.\n?         -> Introduction and overview of IPython's features.\n%quickref -> Quick reference.\nhelp      -> Python's own help system.\nobject?   -> Details about 'object', use 'object??' for extra details.\n\n[?1l[6n[?2004h[?25l[?7l[0m
[0m[J
[?12l[?25h")
  python-shell-comint-watch-for-first-prompt-output-filter("Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) \nType \"copyright\", \"credits\" or \"license\" for more information.\n\nIPython 5.1.0 -- An enhanced Interactive Python.\n?         -> Introduction and overview of IPython's features.\n%quickref -> Quick reference.\nhelp      -> Python's own help system.\nobject?   -> Details about 'object', use 'object??' for extra details.\n\n[?1l[6n[?2004h[?25l[?7l[0m
[0m[J
[?12l[?25h")
  run-hook-with-args(python-shell-comint-watch-for-first-prompt-output-filter "Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) \nType \"copyright\", \"credits\" or \"license\" for more information.\n\nIPython 5.1.0 -- An enhanced Interactive Python.\n?         -> Introduction and overview of IPython's features.\n%quickref -> Quick reference.\nhelp      -> Python's own help system.\nobject?   -> Details about 'object', use 'object??' for extra details.\n\n[?1l[6n[?2004h[?25l[?7l[0m
[0m[J
[?12l[?25h")
  comint-output-filter(#<process Python> "Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) \nType \"copyright\", \"credits\" or \"license\" for more information.\n\nIPython 5.1.0 -- An enhanced Interactive Python.\n?         -> Introduction and overview of IPython's features.\n%quickref -> Quick reference.\nhelp      -> Python's own help system.\nobject?   -> Details about 'object', use 'object??' for extra details.\n\n[?1l[6n[?2004h[?25l[?7l[0m
[0m[J
[?12l[?25h")
  1. The ipython interpreter looks "funky" as well. Normally, line numbers would show up as:

.

In  [1]: 7/9

Out [1]: 0.77777777777777778

In  [2]:

However, I get something like this:

[6n[JIn [2]: [8D[8C7/9

[8D[JIn [2]: 7/9[11D

[JOut[2]: 0.7777777777777778

[6n[JIn [3]: [8D[8C

For the life of me I cannot figure out why the ipython interpreter is so hosed. Any help will be appreciated.

  • Looks like this is a bug in python-mode – ChillarAnand Jan 5 '17 at 5:26
  • Ok, I will submit a bug report. – tnknepp Jan 5 '17 at 19:55
  • I guess I am uncertain why this is a problem bug in python-mode as opposed to elpy. Aren't these separate entities? – tnknepp Jan 5 '17 at 19:57

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.