jorgenschaefer / elpy

Emacs Python Development Environment
GNU General Public License v3.0
1.9k stars 262 forks source link

With IPython, args-out-of-range error when opening file #992

Closed dschrempf closed 6 years ago

dschrempf commented 8 years ago

I use the rope backend.

With (elpy-use-ipython): when I open a Python file for the first time, I get the following error message

Debugger entered--Lisp error: (args-out-of-range "Python 3.5.2 (default, Jun 28 2016, 08:46:01) 
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.



" 400)
  string-match("" "Python 3.5.2 (default, Jun 28 2016, 08:46:01) \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

" 400)
  ansi-color-filter-apply("Python 3.5.2 (default, Jun 28 2016, 08:46:01) \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[?2004h[?25l[?7l

[?12l[?25h")
  python-shell-output-filter("Python 3.5.2 (default, Jun 28 2016, 08:46:01) \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[?2004h[?25l[?7l

[?12l[?25h")
  comint-output-filter(#<process Python Internal[inbreeding-depression.py]> "Python 3.5.2 (default, Jun 28 2016, 08:46:01) \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[?2004h[?25l[?7l

[?12l[?25h")
  accept-process-output(#<process Python Internal[inbreeding-depression.py]>)
  python-shell-send-string-no-output("import sys;print ('\\n'.join(sys.path))" #<process Python Internal[inbreeding-depression.py]>)
  python-shell-internal-send-string("import sys;print ('\\n'.join(sys.path))")
  semantic-python-get-system-include-path()
  (progn (semantic-python-get-system-include-path))
  (if (and (featurep (quote python)) (not noninteractive)) (progn (semantic-python-get-system-include-path)))
  (when (and (featurep (quote python)) (not noninteractive)) (semantic-python-get-system-include-path))
  eval((when (and (featurep (quote python)) (not noninteractive)) (semantic-python-get-system-include-path)))
  custom-initialize-reset(semantic-python-dependency-system-include-path (when (and (featurep (quote python)) (not noninteractive)) (semantic-python-get-system-include-path)))
  custom-declare-variable(semantic-python-dependency-system-include-path (when (and (featurep (quote python)) (not noninteractive)) (semantic-python-get-system-include-path)) "The system include path used by Python language." :group python :group semantic :type (repeat (directory :tag "Directory")) :set #[(sym val) "\303 \"\210  \304\305\nBC\306\307#\210\310\311\307\"\210)\312\313!\205 

When I open the same file another time, it works. The error reappears if I open another Python file.

Please let me know if I can provide further logs or debugging information.

jorgenschaefer commented 8 years ago

Hello, and thanks for the report! If you add (setenv "IPY_TEST_SIMPLE_PROMPT" "1") to your config file and restart, does the problem persist?

dschrempf commented 8 years ago

Hello! Yes, then it works. I get two (maybe unrelated) warnings though:

Shell native completion is disabled, using fallback

Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support readline, yet ‘python-shell-completion-native’ was t and "ipython" is not part of the ‘python-shell-completion-native-disabled-interpreters’ list.  Native completions have been disabled locally. 
jorgenschaefer commented 8 years ago

Yeah, there's a whole lot of confusion going on with IPython 5's new prompt behavior. I hope it'll get fixed in Emacs at some point.

scarcella commented 6 years ago

Thank you! Been trying everything to try fix. This worked

j3ky commented 6 years ago

@jorgenschaefer Thanks!

jorgenschaefer commented 6 years ago

This is now documented here: http://elpy.readthedocs.io/en/latest/ide.html#interpreter-setup