bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#28051: 25.2; Multiline Statement Indentation Error in Inferior Pytho


From: Evgeniy Sharapov
Subject: bug#28051: 25.2; Multiline Statement Indentation Error in Inferior Python Mode
Date: Thu, 24 Aug 2017 22:50:28 -0400

I have pyreadline installed. It does help in a sense that completion works then in the inferior python mode, although I get following *Warning* buffer

Warning (python): Python shell prompts cannot be detected.
If your emacs session hangs when starting python shells
recover with ‘keyboard-quit’ and then try fixing the
interactive flag for your interpreter by adjusting the
‘python-shell-interpreter-interactive-arg’ or add regexps
matching shell prompts in the directory-local friendly vars:
  + ‘python-shell-prompt-regexp’
  + ‘python-shell-prompt-block-regexp’
  + ‘python-shell-prompt-output-regexp’
Or alternatively in:
  + ‘python-shell-prompt-input-regexps’
  + ‘python-shell-prompt-output-regexps’
Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support readline, yet ‘python-shell-completion-native-enable’ was t and "python" is not part of the ‘python-shell-completion-native-disabled-interpreters’ list.  Native completions have been disabled locally. 



But the *Python* buffer says everythng has been loaded ok


Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> python.el: native completion setup loaded
>>>




==========================================
  Evgeniy N. Sharapov
  Phone: (630) - 779 - 3208
 

On Sat, Aug 19, 2017 at 10:45 AM, <npostavs@users.sourceforge.net> wrote:
evgeniy.sharapov@gmail.com writes:

> leads to IndentationError once I try to enter multi-line statements in
> the Inferior python mode.
>
> Steps:
>
> 1. Start Emacs
> 2. M-x run-python
> 3. try to enter something simple like
>
>    for x in range(10):<RET>
>    <TAB>print x<RET>
>
> 4. The following error occurs:
>
> File "<stdin>", line 1
>     print x
>     ^
> IndentationError: unexpected indent

Does it help if you install pyreadline?  From comments in python.el:

    ;; If your
    ;; Python installation lacks readline (like CPython for Windows),
    ;; installing pyreadline (URL `http://ipython.org/pyreadline.html')
    ;; should suffice.  To troubleshoot why you are not getting any
    ;; completions, you can try the following in your Python shell:

    ;; >>> import readline, rlcompleter

    ;; If you see an error, then you need to either install pyreadline or
    ;; setup custom code that avoids that dependency.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]